2022-01-10  Dmitry V. Levin  <ldv@strace.io>

	Prepare for 5.16 release.
	* NEWS: Update for 5.16 release.

	.mailmap: add more entries to avoid duplication in CREDITS.
	* .mailmap: Add another email address of Paul Chaignon to avoid
	duplication in CREDITS file.

2022-01-09  Dmitry V. Levin  <ldv@strace.io>

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2022-01-09  Dmitry V. Levin  <ldv@strace.io>

	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:]]' src tests |grep -v '\.sh$') |while read f; do
		cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
	done

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	net: remove PACKET_ADD_MEMBERSHIP #ifdef guards.
	Both PACKET_ADD_MEMBERSHIP and struct packet_mreq are provided by
	<linux/if_packet.h> at least since Linux 2.6.12.

	* src/xlat/packet_mreq_type.in: Add #value_indexed, provide fallback
	definitions.
	* src/net.c: Remove PACKET_ADD_MEMBERSHIP #ifdef guards.

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	net: remove PACKET_RX_RING and PACKET_TX_RING #ifdef guards.
	All of them as well as struct tpacket_req are provided by
	<linux/if_packet.h> at least since Linux 2.6.12.

	* src/net.c: Remove PACKET_RX_RING and PACKET_TX_RING #ifdef guards.

	Complements: v5.15~139 "xlat: add fallback values to sock_packet_options"

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	net: remove IPV6_ADD_MEMBERSHIP and IPV6_{JOIN,LEAVE}_ANYCAST guards.
	All of them are present since at least Linux 2.6.12 and glibc-2.3.3~616.

	* src/net.c [!IPV6_ADD_MEMBERSHIP] (print_mreq6): Enable function
	declaration.
	[!IPV6_ADD_MEMBERSHIP || !IPV6_JOIN_ANYCAST || !IPV6_LEAVE_ANYCAST] (print_setsockopt):
	Enable case IPV6_ADD_MEMBERSHIP, case IPV6_DROP_MEMBERSHIP,
	case IPV6_JOIN_ANYCAST, and case IPV6_LEAVE_ANYCAST.

	Complements: v5.15~140 "xlat: add fallback values to sock_ipv6_options"

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Remove MCAST_JOIN_GROUP #ifdef guards.
	These are long defined (before Linux 2.6.12 and since glibc-2.3.4~748),
	so there seems to be no need to conditionalise on them.

	* src/net.c [!MCAST_JOIN_GROUP]: Enable case MCAST_JOIN_GROUP
	and case MCAST_LEAVE_GROUP.
	* src/print_group_req.c [!MCAST_JOIN_GROUP]: Enable
	DEF_MPERS_TYPE(struct_group_req) include, struct_group_req typedef,
	and print_group_req function.

	Complements: v5.15~141 "xlat: add fallback values to sock_ip_options"
	Complements: v5.15~140 "xlat: add fallback values to sock_ipv6_options"

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	net: remove IP_ADD_MEMBERSHIP #ifdef guards.
	IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP are always defined since commit
	v5.15~141 "xlat: add fallback values to sock_ip_options", and the struct
	ip_mreq definition is present in UAPI since at least v2.6.12, so simply
	remove the #ifdef guards.

	* src/net.c [!IP_ADD_MEMBERSHIP] (print_mreq): Provide definition.
	[!IP_ADD_MEMBERSHIP] (print_setsockopt): Enable case IP_ADD_MEMBERSHIP
	and case IP_DROP_MEMBERSHIP.

	Complements: v5.15~141 "xlat: add fallback values to sock_ip_options"

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	net: remove PACKET_STATISTICS #ifdef guards.
	The constant is always defined since v5.15~139 "xlat: add fallback values
	to sock_packet_options", and the decoder function does not require
	any extra definitions, so the #fidef guards are now superficial.

	* src/net.c [!PACKET_STATISTICS] (print_tpacket_stats): Make available.
	[!PACKET_STATISTICS] (print_getsockopt) <case SOL_PACKET: case
	PACKET_STATISTICS>: Call print_tpacket_stats.

	Complements: v5.15~139 "xlat: add fallback values to sock_packet_options"

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	net: initialise struct icmp_filter read buffer with ~0.
	Since only the unset bits are printed, this avoids printing
	of bits not returned by the kernel when a short read is performed.

	* src/net.c (print_icmp_filter): Set filter.data to ~0U.

2022-01-09  Eugene Syromyatnikov  <evgsyr@gmail.com>

	net: fix SO_ERROR socket option len clamping.
	Looks like a typo: err is set if len is too big instead of len.
	Fixes possible out-of-bounds read on umoven_or_printaddr when len
	is too big.

	* src/net.c (print_get_error) <if (len > sizeof(err))>: Set len
	to sizeof(err) and not err.

	Fixes: v4.26~45 "net: enhance decoding of getsockopt(SO_ERROR)"

2022-01-09  Dmitry V. Levin  <ldv@strace.io>

	tests: check decoding of futex_waitv syscall.
	* tests/futex_waitv.c: New file.
	* tests/gen_tests.in (futex_waitv): New test.
	* tests/pure_executables.list: Add futex_waitv.
	* tests/.gitignore: Likewise.

	futex_waitv: implement decoding of struct futex_waitv array.
	* bundled/linux/include/uapi/linux/futex.h: New file, imported from
	headers_install'ed Linux kernel v5.16-rc8.
	* bundled/Makefile.am (EXTRA_DIST): Add it.
	* src/xlat/futex_waiter_flags.in: New file.
	* src/futex_waitv.c: Include <linux/futex.h> and
	"xlat/futex_waiter_flags.h".
	(print_waiter_data): New struct.
	(print_waiter, print_waiter_array): New functions.
	(SYS_FUNC(futex_waitv)): Use print_waiter_array to print the first
	argument of futex_waitv syscall.
	* NEWS: Mention this change.

2022-01-09  André Almeida  <andrealmeid@collabora.com>

	Implement decoding of futex_waitv syscall.
	This is an initial implementation of the new futex_waitv syscall
	introduced by Linux kernel commit v5.16-rc1~200^2~12.

	* src/futex_waitv.c: New file.
	* src/Makefile.am (libstrace_a_SOURCES): Add it.
	* src/linux/generic/syscallent-common.h ([BASE_NR + 449]): Add
	futex_waitv syscall entry.

2022-01-08  Dmitry V. Levin  <ldv@strace.io>

	xlat: update NDA_* constants.
	* src/xlat/rtnl_neigh_attrs.in (NDA_FLAGS_EXT): New constant
	introduced by Linux kernel commit v5.16-rc1~159^2~222^2~1.
	* NEWS: Mention this change.

	xlat: update V4L2_* constants.
	* src/xlat/v4l2_control_id_bases.in (V4L2_CID_USER_ALLEGRO_BASE): New
	constant introduced by Linux kernel commit v5.16-rc1~173^2~15.
	* src/xlat/v4l2_control_ids.in (V4L2_CID_NOTIFY_GAINS): New constant
	introduced by Linux kernel commit v5.16-rc1~173^2~231.
	* src/xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_SUNXI_TILED_NV12): Rename
	to V4L2_PIX_FMT_NV12_32L32, renamed by Linux kernel commit
	v5.16-rc1~173^2~279.
	(V4L2_PIX_FMT_HM12): Rename to V4L2_PIX_FMT_NV12_16L16, renamed by Linux
	kernel commit v5.16-rc1~173^2~278.
	(V4L2_PIX_FMT_NV12_4L4): New constant introduced by Linux kernel commit
	v5.16-rc1~173^2~277.
	(V4L2_PIX_FMT_MM21): New constant introduced by Linux kernel commit
	v5.16-rc1~173^2~262.
	* NEWS: Mention this change.

	xlat: update KVM_* constants.
	* src/xlat/kvm_exit_reason.in (KVM_EXIT_RISCV_SBI): New constant
	introduced by Linux kernel commit v5.16-rc1~153^2~50^2~2.
	* NEWS: Mention this change.

	xlat: update DEVCONF_* constants.
	* src/xlat/inet6_devconf_indices.in (DEVCONF_NDISC_EVICT_NOCARRIER):
	New constant introduced by Linux kernel commit v5.16-rc1~159^2~3^2~1.
	* NEWS: Mention this change.

	xlat: update IPV4_DEVCONF_* constants.
	* src/xlat/inet_devconf_indices.in (IPV4_DEVCONF_ARP_EVICT_NOCARRIER-1):
	New constant introduced by Linux kernel commit v5.16-rc1~159^2~3^2~2.
	* NEWS: Mention this change.

	xlat: update ETH_P_* constants.
	* src/xlat/ethernet_protocols.in (ETH_P_REALTEK): New constant
	introduced by Linux kernel commit v5.16-rc1~159^2~168^2~6.
	* NEWS: Mention this change.

	xlat: update FAN_* constants.
	* src/xlat/fan_event_flags.in (FAN_FS_ERROR): New constant introduced
	by Linux kernel commit v5.16-rc1~101^2~16.
	* tests/fanotify_mark.c (main): Update expected output.
	* NEWS: Mention this change.

	xlat: update BTRFS_* constants.
	* src/xlat/btrfs_send_flags.in (BTRFS_SEND_FLAG_VERSION): New constant
	introduced by Linux kernel commit v5.16-rc1~203^2~6.

	bundled: update linux UAPI headers to v5.16-rc8.
	* bundled/linux/include/uapi/asm-generic/fcntl.h: Update to
	headers_install'ed Linux kernel v5.16-rc8.
	* bundled/linux/include/uapi/linux/btrfs.h: Likewise.
	* bundled/linux/include/uapi/linux/io_uring.h: Likewise.
	* bundled/linux/include/uapi/linux/mctp.h: Likewise.
	* bundled/linux/include/uapi/linux/neighbour.h: Likewise.
	* bundled/linux/include/uapi/linux/netfilter/nf_tables.h: Likewise.
	* bundled/linux/include/uapi/linux/nfc.h: Likewise.
	* bundled/linux/include/uapi/linux/perf_event.h: Likewise.
	* bundled/linux/include/uapi/linux/pkt_sched.h: Likewise.
	* bundled/linux/include/uapi/linux/prctl.h: Likewise.
	* bundled/linux/include/uapi/linux/v4l2-controls.h: Likewise.
	* bundled/linux/include/uapi/linux/version.h: Likewise.
	* bundled/linux/include/uapi/linux/videodev2.h: Likewise.
	* bundled/linux/include/uapi/linux/vm_sockets.h: Likewise.

2022-01-07  Dmitry V. Levin  <ldv@strace.io>

	xlat: update AUDIT_* constants.
	* xlat/nl_audit_types.in (AUDIT_URINGOP): New constant introduced
	by Linux kernel commit v5.16-rc1~162^2~18.
	(AUDIT_OPENAT2): New constant introduced by Linux kernel commit
	v5.16-rc1~161^2~1.
	(AUDIT_DM_CTRL, AUDIT_DM_EVENT): New constants introduced by Linux
	kernel commit v5.16-rc1~77^2~12.
	* NEWS: Mention this change.

	xlat: update SO_VM_* constants.
	* bundled/linux/include/uapi/linux/vm_sockets.h: Update to
	headers_install'ed Linux kernel v5.16-rc8.
	* src/xlat/sock_vsock_options.in (SO_VM_SOCKETS_CONNECT_TIMEOUT): Rename
	to SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD, renamed by Linux kernel commit
	v5.16-rc1~159^2~251.
	(SO_VM_SOCKETS_CONNECT_TIMEOUT_NEW): New constant introduced by the same
	commit.

	xlat: update SO_* constants.
	* src/xlat/sock_options.in (SO_RESERVE_MEM): New constant introduced
	by Linux kernel commit v5.16-rc1~159^2~317^2~2.
	* NEWS: Mention this change.

2022-01-06  Dmitry V. Levin  <ldv@strace.io>

	Update copyright year number range.
	* COPYING: Update copyright year number range.
	* tests/COPYING: Likewise.
	* debian/copyright: Likewise.

2022-01-06  Dmitry V. Levin  <ldv@strace.io>

	mips: remove redundant include of syscall_dummy.h.
	As syscall_dummy.h is already included by syscall.h, there is no need
	to include it once more in syscallent.h.

	* src/linux/mips/syscallent.h: Do not include "syscall_dummy.h".

2022-01-05  Dmitry V. Levin  <ldv@strace.io>

	Rework personality_designators and personality_names.
	Move personality_designators definition to the same file with
	its sole user, move arch-specific initialization to arch_defs.h.

	* src/linux/x32/arch_defs_.h (PERSONALITY_DESIGNATORS,
	PERSONALITY_NAMES): New macros.
	* src/linux/x86_64/arch_defs_.h: Likewise.
	* src/arch_defs.h [!PERSONALITY_DESIGNATORS, !PERSONALITY_NAMES]:
	Likewise.
	* src/basic_filters.c (personality_designators): New array.
	* src/defs.h (personality_designators): Remove.
	* src/syscall.c: Likewise.
	(personality_names): Use PERSONALITY_NAMES, add static_assert.

2022-01-04  Dmitry V. Levin  <ldv@strace.io>

	Remove linux/generic/arch_defs_.h.
	Starting with commit v5.15~212, every supported architecture has to
	define PERSONALITY0_AUDIT_ARCH which effectively means that every
	supported architecture has its own arch_defs_.h file, and the generic
	arch_defs_.h is no longer needed.

	* src/Makefile.am (EXTRA_DIST): Remove linux/generic/arch_defs_.h.
	* src/linux/generic/arch_defs_.h: Remove.

	Complements: v5.15~212 "src/linux: add PERSONALITY0_AUDIT_ARCH definitions where possible"

2022-01-04  Renaud Métrich  <rmetrich@redhat.com>
	    Dmitry V. Levin  <ldv@strace.io>

	Implement displaying of expected context upon mismatch.
	New option to --secontext=... (also available as -e secontext=...)
	- mismatch: print expected context on mismatch

	When using 'mismatch', an additional check is made on the context by
	reading the context database and comparing the output after stripping
	the unwanted part (e.g. stripping nothing in 'full' mode, keeping the
	type only in default mode):
	- if it differs, prints the expected context after printing '!!'
	- if not, don't print anything

	Example with /home/rmetrich/GIT/strace/autom4te.cache/output.3 file:

	----
	$ matchpathcon /home/rmetrich/GIT/strace/autom4te.cache/output.3
	/home/rmetrich/GIT/strace/autom4te.cache/output.3	unconfined_u:object_r:user_home_t:s0

	$ ls -Z /home/rmetrich/GIT/strace/autom4te.cache/output.3
	system_u:object_r:user_home_t:s0 /home/rmetrich/GIT/strace/autom4te.cache/output.3
	----

	From above, we see the user part differs ('unconfined_u' vs 'system_u')

	Output in '!full' mode (no diff found on type):

	----
	$ strace --secontext=mismatch -e statx stat /home/rmetrich/GIT/strace/autom4te.cache/output.3
	... statx(AT_FDCWD, "/home/rmetrich/GIT/strace/autom4te.cache/output.3" [user_home_t], ...
	----

	Output in 'full' mode (diff found on user):

	----
	... statx(AT_FDCWD, "/home/rmetrich/GIT/strace/autom4te.cache/output.3" [system_u:object_r:user_home_t:s0!!unconfined_u:object_r:user_home_t:s0], ...
	----

	* NEWS: Mention this change.
	* doc/strace.1.in: Document it.
	* m4/st_selinux.m4 (st_SELINUX): Check for selabel_open
	and selabel_lookup.
	* src/filter_qualify.c [ENABLE_SECONTEXT]: Include "secontext.h".
	[ENABLE_SECONTEXT] (secontext_set): New variable.
	[ENABLE_SECONTEXT] (secontextstr_to_uint, qualify_secontext): New
	functions.
	(qual_options) [ENABLE_SECONTEXT]: Add "secontext".
	* src/secontext.c: Include <sys/stat.h>, <unistd.h>, <selinux/label.h>,
	"largefile_wrappers.h", "number_set.h", and "xmalloc.h".
	(selinux_context, selinux_context_full): Remove.
	(getcontext): Use is_number_in_set instead of selinux_context_full.
	(selinux_getpidcon): Use is_number_in_set instead of selinux_context.
	(get_expected_filecontext): New function.
	(selinux_getfdcon, selinux_getfilecon): Use it to print context mismatch
	if SECONTEXT_MISMATCH is set in secontext_set.
	* src/secontext.h (selinux_context, selinux_context_full): Remove.
	(secontext_bits): New enum.
	(secontext_set, qualify_secontext, selinux_set_format): New
	declarations.
	* src/strace.c (SECONTEXT_E_QUAL): New macro.
	(usage): Use it, describe --secontext.
	(init) [ENABLE_SECONTEXT]: Call qualify_secontext, rename
	GETOPT_SECONTEXT to GETOPT_QUAL_SECONTEXT, use is_number_in_set
	instead of selinux_context.
	(init) [ENABLE_SECONTEXT] (secontext_qual): New variable.
	(init) [ENABLE_SECONTEXT] <GETOPT_QUAL_SECONTEXT>: Use it.
	* tests/.gitignore: Add *--secontext_full_mismatch,
	*--secontext_full_mismatch.c, *--secontext_mismatch, and
	*--secontext_mismatch.c.
	* tests/gen_secontext.sh: Generate *--secontext_full_mismatch.c
	and *--secontext_mismatch.c.
	* tests/gen_tests.in (access--secontext_full_mismatch,
	access--secontext_mismatch, chmod--secontext_full_mismatch,
	chmod--secontext_mismatch, execve--secontext_full_mismatch,
	execve--secontext_mismatch, execveat--secontext_full_mismatch,
	execveat--secontext_mismatch, faccessat--secontext_full_mismatch,
	faccessat--secontext_mismatch, faccessat-y--secontext_full_mismatch,
	faccessat-y--secontext_mismatch, fanotify_mark--secontext_full_mismatch,
	fanotify_mark--secontext_mismatch, fchmod--secontext_full_mismatch,
	fchmod--secontext_mismatch, fchmod-y--secontext_full_mismatch,
	fchmod-y--secontext_mismatch, fchmodat--secontext_full_mismatch,
	fchmodat--secontext_mismatch, fchownat--secontext_full_mismatch,
	fchownat--secontext_mismatch, file_handle--secontext_full_mismatch,
	file_handle--secontext_mismatch, linkat--secontext_full_mismatch,
	linkat--secontext_mismatch, open--secontext_full_mismatch,
	open--secontext_mismatch, openat--secontext_full_mismatch,
	openat--secontext_mismatch): New tests.
	* tests/linkat.c: Include <string.h>.
	(main) [PRINT_SECONTEXT_MISMATCH]: Check context mismatch.
	* tests/options-syntax.test: Check --secontext and -e secontext syntax.
	* tests/secontext.h (secontext_field): New enum.
	(secontext_full_file, secontext_short_file): Add "mismatch" argument.
	(update_secontext_type): Rename to update_secontext_field, add "field"
	argument.
	(SECONTEXT_FILE): Conditionalize "mismatch" argument passed to
	secontext_full_file and secontext_short_file on
	PRINT_SECONTEXT_MISMATCH.
	* tests/secontext.c: Include <sys/stat.h> and <selinux/label.h>.
	(get_type_from_context, raw_expected_secontext_full_file,
	raw_expected_secontext_short_file): New functions.
	(raw_secontext_short_file, raw_secontext_short_pid): Use
	get_type_from_context.
	(secontext_full_file): Add "mismatch" argument, use
	raw_expected_secontext_full_file if mismatch is enabled.
	(secontext_short_file): Add "mismatch" argument, use
	raw_expected_secontext_short_file if mismatch is enabled.
	(update_secontext_type): Rename to update_secontext_field, add "field"
	argument.

2022-01-03  Dmitry V. Levin  <ldv@strace.io>

	Update .mailmap.
	* .mailmap: Add both email addresses of Ahelenia Ziemiańska to avoid
	duplication in CREDITS file.

2022-01-03  наб  <nabijaczleweli@nabijaczleweli.xyz>

	Regenerate OpenZFS ioctls with vdev props.
	* src/ioctls_zfs.h (ZFS_IOC_VDEV_GET_PROPS, ZFS_IOC_VDEV_SET_PROPS): New
	entries.

2022-01-02  Dmitry V. Levin  <ldv@strace.io>

	tests: bring lists back to the sorted order.
	* tests/Makefile.am (check_PROGRAMS): Make the list sorted again.
	* tests/gen_tests.in: Likewise.
	* tests/pure_executables.list: Likewise.
	* tests/.gitignore: Likewise.

2022-01-01  Dmitry V. Levin  <ldv@strace.io>

	Use a separate manpage date for strace-log-merge.1.
	strace-log-merge.1 used cause confusion by sharing the manpage date
	with strace.1.

	* Makefile.am (dist-hook): Rename MANPAGE_DATE to STRACE_MANPAGE_DATE,
	generate $(distdir)/doc/.strace-log-merge.1.in.date.
	* configure.ac (manpage_date): Rename to strace_manpage_date.
	(slm_manpage_date): Define from doc/strace-log-merge.1.in.
	(MANPAGE_DATE): Rename to STRACE_MANPAGE_DATE.
	(SLM_MANPAGE_DATE): Define to slm_manpage_date.
	* doc/strace-log-merge.1.in: Replace MANPAGE_DATE with SLM_MANPAGE_DATE.
	* doc/strace.1.in: Replace MANPAGE_DATE with STRACE_MANPAGE_DATE.
	* strace.spec.in: Likewise, generate doc/.strace-log-merge.1.in.date.

2021-12-30  Sahil Kang  <sahil.kang@asilaycomputing.com>

	btrfs: add decoding of fs_info checksum, generation and metadata.
	* src/xlat/btrfs_csum_types.in: New file.
	* src/xlat/btrfs_fs_info_flags.in: Likewise.
	* src/btrfs.c: Include "xlat/btrfs_csum_types.h" and
	"xlat/btrfs_fs_info_flags.h".
	(btrfs_ioctl): Print csum_type, csum_size, flags, generation,
	and metadata_uuid fields of struct btrfs_ioctl_fs_info_args.
	* NEWS: Mention it.
	* tests/btrfs.c: Include "print_utils.h", "xlat/btrfs_csum_types.h",
	and "xlat/btrfs_fs_info_flags.h".
	(print_hex, print_uuid, btrfs_print_fs_info_args,
	btrfs_fs_info_args_subtest): New functions.
	(btrfs_test_fs_info_ioctl): New function for write_ok mode.
	(main): Use btrfs_test_fs_info_ioctl.

	tests: fix btrfs read-write tests.
	* tests/btrfs.c (btrfs_test_subvol_ioctls): Remove deprecated
	BTRFS_SUBVOL_CREATE_ASYNC flag to prevent -EOPNOTSUPP.
	(btrfs_test_ino_path_ioctls): Add fe_flags= field prefix to printed output.

2021-12-30  Paul Chaignon  <paul@isovalent.com>

	bpf: add support for new fields in struct bpf_prog_info.
	* src/bpf_attr.h (struct bpf_prog_info_struct): Add recursion_misses and
	verified_insns fields.
	(expected_bpf_prog_info_struct_size): Update.
	* src/bpf.c (print_bpf_prog_info): Decode recursion_misses and
	verified_insns fields introduced by Linux kernel commits
	v5.12-rc1~200^2~28^2~28 and v5.16-rc1~159^2~2^2~43^2~1.
	* tests/bpf-obj_get_info_by_fd.c (main): Update expected output.

	bpf: support commands BPF_LINK_GET_*_ID.
	* src/bpf.c (BEGIN_BPF_CMD_DECODER(BPF_LINK_GET_FD_BY_ID): Decode the
	BPF_LINK_GET_FD_BY_ID command.
	(decode_BPF_BTF_GET_NEXT_ID): New macro.
	(SYS_FUNC(bpf)): Decode the commands.
	* src/bpf_attr.h (BPF_LINK_GET_FD_BY_ID_struct): New structure introduced
	by Linux commit v5.8-rc1~165^2~343^2~16^2~8.
	(BPF_LINK_GET_FD_BY_ID_struct_size): New macro.
	* NEWS: Mention this.
	* tests/bpf.c (union bpf_attr_data): Add BPF_LINK_GET_FD_BY_ID.
	(BPF_LINK_GET_FD_BY_ID_checks): Test for the BPF_LINK_GET_FD_BY_ID
	command.
	(BPF_LINK_GET_NEXT_ID_checks): New macro.
	(main) <checks>: Add BPF_LINK_GET_NEXT_ID and BPF_LINK_GET_FD_BY_ID.

	bpf: support new fields for BPF_PROG_TEST_RUN.
	* src/bpf_attr.h (BPF_PROG_TEST_RUN_struct): Add flags and cpu fields
	introduced by Linux kernel commit v5.10-rc1~107^2~96^2~36.
	(expected_BPF_PROG_TEST_RUN_struct_size): Update.
	* src/xlat/bpf_test_run_flags.in: New file.
	* src/bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_TEST_RUN)): Decode the new
	fields.
	* NEWS: Mention this.
	* tests/bpf.c (BPF_PROG_TEST_RUN_check): Update expected output.

	bpf: implement decoding of BPF_PROG_LOAD fd_array field.
	* src/bpf_attr.h (BPF_PROG_LOAD_struct): Add fd_array field introduced by
	Linux kernel commit v5.6-rc1~151^2~46^2~37^2~5.
	(expected_BPF_PROG_LOAD_struct_size): Update.
	* src/bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Decode the new field.
	* NEWS: Mention this.
	* tests/bpf-obj_get_info_by_fd.c (print_prog_load): Update expected
	output.
	* tests/bpf.c (BPF_PROG_LOAD_checks): Likewise.
	* tests/kernel_version.c (print_bpf_attr): Likewise.

	bpf: implement decoding of BPF_MAP_CREATE map_extra field.
	* src/bpf_attr.h (BPF_MAP_CREATE_struct): Add map_extra field introduced
	by Linux kernel commit v5.6-rc1~151^2~46^2~37^2~5.
	(bpf_map_info_struct): Likewise.
	(expected_BPF_MAP_CREATE_struct_size, expected_bpf_map_info_struct_size):
	Update.
	* src/bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Decode the new field.
	* NEWS: Mention this.
	* tests/bpf-obj_get_info_by_fd.c (print_map_create): Update expected
	output.
	* tests/bpf.c (BPF_MAP_CREATE_checks): Add a check that includes the
	map_extra field.

	bpf: update BPF_* constants.
	* src/xlat/bpf_map_types.in (BPF_MAP_TYPE_BLOOM_FILTER): New constant
	introduced in Linux kernel commit v5.16-rc1~159^2~2^2~20^2~4.
	* src/xlat/bpf_attach_types.in (BPF_PERF_EVENT): New constant introduced
	in Linux kernel commit v5.15-rc1~157^2~22^2~33^2~12.
	* tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_QUERY_checks): Update
	checks and their expected output.
	* NEWS: Mention this.

2021-12-26  Dmitry V. Levin  <ldv@strace.io>

	Move some gcc-agnostic macros from gcc_compat.h to macros.h.
	* src/gcc_compat.h (SAME_TYPE): Document it, rename to IS_SAME_TYPE.
	(FAIL_BUILD_ON_ZERO, MUST_BE_ARRAY): Move ...
	* src/macros.h: ... here, document them.
	(IS_NOT_ARRAY): New macro.
	* src/xstring.h: Include "macros.h" instead of "gcc_compat.h".

2021-12-25  Dmitry V. Levin  <ldv@strace.io>

	tests/ptrace: fix expected output for riscv64.
	* tests/ptrace.c (print_prstatus_regset] [__riscv]: Do not print
	delimiters before regs->pc.

	Fixes: v5.13~255 "riscv64: implement PTRACE_{G,S}ETREGSET NT_PRSTATUS regset decoding"

2021-12-25  Dmitry V. Levin  <ldv@strace.io>

	tests: fix riscv64 support.
	Apparently, the preprocessor macro defined by gcc for riscv64 is __riscv
	instead of __riscv__ as one might expect.

	* tests/bpf.c: Replace __riscv__ with __riscv.
	* tests/cur_audit_arch.h: Likewise.
	* tests/io_uring_register.c: Likewise.
	* tests/ptrace.c: Likewise.

	Fixes: v4.22~18 "bpf: use print_big_u64_addr"
	Fixes: v5.5~41 "io_uring: add support for IORING_REGISTER_FILES_UPDATE"
	Fixes: v5.13~255 "riscv64: implement PTRACE_{G,S}ETREGSET NT_PRSTATUS regset decoding"
	Fixes: v5.15~210 "tests: add cur_audit_arch.h"

2021-12-17  Chih-Hsuan Yen  <yan12125@gmail.com>

	Fix building for older Android.
	With the following commands,

	    $ ./bootstrap
	    $ _pkg_arch=aarch64
	    $ export PATH="/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH"
	    $ CC=$_pkg_arch-linux-android21-clang \
	      ./configure --prefix=/opt/android-libs/${_pkg_arch/_/-} \
	        --host=$_pkg_arch-linux-android \
	        --without-libunwind \
	        --enable-mpers=no \
	        --disable-gcc-Werror
	    $ make

	Building fails with error diagnostics like this:

	    In file included from sync_file_range.c:12:
	    ./xlat/sync_file_range_flags.h:7:16: error: use of undeclared identifier 'SYNC_FILE_RANGE_WAIT_BEFORE'
	    static_assert((SYNC_FILE_RANGE_WAIT_BEFORE) == (1), "SYNC_FILE_RANGE_WAIT_BEFORE != 1");

	This is a build regression from bd87cc95120b3707a6fe55129451bb0453730a6d,
	where "#unconditional" is added given that <linux/fs.h> is bundled,
	but the latter is not explicitly #include'd.

	As a side note, SYNC_FILE_RANGE* symbols are not available with
	ANDROID_API__ < 26 [1].

	[1] https://android.googlesource.com/platform/bionic/+/refs/tags/android-12.0.0_r15/libc/include/fcntl.h#98

	* src/sync_file_range.c: Include <linux/fs.h>.
	* src/sync_file_range2.c: Likewise.

	Fixes: v5.15~76 "xlat: add #unconditional to sync_file_range_flags"

2021-12-13  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	Update ioctl entries from linux v5.16.
	* src/linux/32/ioctls_inc_align16.h: Update from linux v5.16-rc5
	  using ioctls_gen.sh.
	* src/linux/32/ioctls_inc_align32.h: Likewise.
	* src/linux/32/ioctls_inc_align64.h: Likewise.
	* src/linux/64/ioctls_inc.h: Likewise.
	* src/linux/x32/ioctls_inc0.h: Likewise.
	* src/linux/i386/ioctls_arch0.h: Likewise.
	* src/linux/x86_64/ioctls_arch0.h: Likewise.
	* NEWS: Mention this.

	maint: update for linux v5.16-rc5.
	* maint/ioctls_sym.sh: Workaround incompatible definition of
	__alloc_size__ macro introduced by the Linux commit v5.16-rc1~106^2~224.

2021-12-04  Dmitry V. Levin  <ldv@strace.io>

	tests: adopt net-yy-unix test to the latest kernel changes.
	As noted in the previous commit, the Linux kernel commit
	v5.15-rc1~157^2~22^2~30^2~3 changed the value of system.sockprotoname
	attribute for AF_UNIX SOCK_STREAM sockets from "UNIX" to "UNIX-STREAM".
	Consequently, the test cannot assume any particular value for this
	attribute anymore.

	* tests/net-yy-unix.c [HAVE_SYS_XATTR_H]: Include <sys/xattr.h>
	and "xmalloc.h".
	(main) [HAVE_SYS_XATTR_H]: Use the value of system.sockprotoname
	attribute instead of fixed string "UNIX".

2021-12-03  Eugene Syromyatnikov  <evgsyr@gmail.com>

	socketutils: add "UNIX-STREAM" protocol support.
	It is the same as the old AF_UNIX for all intents and purposes,
	but it has a different name since v5.15-rc1~157^2~22^2~30^2~3
	(and, due to the fact that Chrome OS uses datagrm AF_UNIX sockets
	and not stream ones, it hasn't been fixed back in v5.15-rc6~34^2~22).

	Reported-by: Renaud Métrich <rmetrich@redhat.com>
	Reported-by: Dmitry V. Levin <ldv@strace.io>

2021-12-02  Eugene Syromyatnikov  <evgsyr@gmail.com>

	xlat: update KVM_CAP_* constants.
	* src/xlat/kvm_cap.in (KVM_CAP_HYPERV_ENFORCE_CPUID): New constant,
	introduced by Linux commit v5.14-rc1~166^2~173.
	(KVM_CAP_SREGS2): New constant, introduced by Linux commit
	v5.14-rc1~166^2~138.
	(KVM_CAP_EXIT_HYPERCALL): New constant, introduced by Linux commit
	v5.14-rc1~166^2~107.
	(KVM_CAP_PPC_RPT_INVALIDATE): New constant, introduced by Linux commit
	v5.14-rc1~104^2~71^2~2, obtained its value in Linux commit
	v5.14-rc1~166^2~92.
	(KVM_CAP_BINARY_STATS_FD): New constant, introduced by Linux commit
	v5.14-rc1~166^2~66.
	(KVM_CAP_EXIT_ON_EMULATION_FAILURE): New constant, introduced by Linux
	commit v5.14-rc1~166^2~5.
	(KVM_CAP_ARM_MTE): New constant, introduced by Linux commit
	v5.14-rc1~166^2^2~1^2~4, obtained its value in Linux commit
	v5.14-rc1~166^2.
	(KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM): New constant, introduced by Linux
	commit v5.16-rc1~29^2~4^2~3.

2021-12-02  Dmitry V. Levin  <ldv@strace.io>

	ci: re-enable testing with the latest mainline kernel headers.
	There should be no issues with v5.16-rc3.

	* .github/workflows/ci.yml (env): Remove KBRANCH.
	* .gitlab-ci.yml (variables): Likewise.
	* .travis.yml (env:global): Likewise.

2021-12-02  Dmitry V. Levin  <ldv@strace.io>

	Post-release administrivia.
	* NEWS: Add a header line for the next release.
	* debian/changelog.in: Add a changelog entry for 5.15-1.
	* strace.spec.in: Likewise.

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

	Prepare for 5.15 release.
	* NEWS: Update for 5.15 release.

2021-12-01  Eugene Syromyatnikov  <evgsyr@gmail.com>

	print_ifindex: fix IFNAME_QUOTED_SZ definition.
	sizeof(IFNAMSIZ) instead of IFNAMSIZ was mistakenly used
	for IFNAME_QUOTED_SZ initial definition in commit v4.23~87
	"print_ifindex: respect xlat style settings".

	* src/print_ifindex.c (IFNAME_QUOTED_SZ): Use IFNAMSIZ
	instead of sizeof(IFNAMSIZ).
	* NEWS: Mention it.

	Reported-by: Paulo Andrade <pandrade@redhat.com>
	Suggested-by: Paulo Andrade <pandrade@redhat.com>
	Fixes: v4.23~87 "print_ifindex: respect xlat style settings"
	References: https://bugzilla.redhat.com/show_bug.cgi?id=2028146

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

	tests: move keyctl syscalls of keyctl tests into a subprocess.
	For some mysterious reason, this helps to workaround
	the following resource starvation issue on some systems:

	  $ ./keyctl >/dev/null && /bin/true
	  -sh: fork: retry: Resource temporarily unavailable
	  -sh: fork: retry: Resource temporarily unavailable
	  -sh: fork: retry: Resource temporarily unavailable
	  -sh: fork: retry: Resource temporarily unavailable
	  -sh: fork: Resource temporarily unavailable

	* tests/keyctl.c: Include <sys/wait.h>.
	(pid): New variable.
	(do_keyctl): Update expected output.
	(main): Fork a subprocess and move all keyctl syscalls there,
	update expected output.
	* tests/gen_tests.in (keyctl, keyctl-Xabbrev, keyctl-Xraw,
	keyctl-Xverbose): Add options: -f --signal='!chld'.

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

	tests/keyctl.c: make all global variables static.
	* tests/keyctl.c (nul_terminated_buf, buf_in_arg): Add static qualifier.

	Update copyright headers.
	Headers updated automatically using maint/update_copyright_years.sh
	script.

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

	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:]]' src tests |grep -v '\.sh$') |while read f; do
		cppi < "$f" > "$f".cppi; mv "$f".cppi "$f"
	done

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

	Fix typos found using codespell tool.
	* debian/changelog.in: Replace "archictectures" with "architectures".
	* tests/cur_audit_arch.h: Replace "arcitectures" with "architectures".

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

	tests: fix net-sockaddr test on older systems.
	* tests/net-sockaddr.c (check_ipx): Explicitly initialize ipx->sipx_zero
	before use.

	Fixes: v5.14-96-g8352a541f "sockaddr: print struct sockaddr_ipx.sipx_zero if it is non-zero"

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

	tests: robustify ioctl_hdio tests.
	* tests/ioctl_hdio.c (main): Do not assume 0xdeadbeef is an inaccessible
	pointer because sometimes this address is accessible, create an
	inaccessible pointer and use it instead of 0xdeadbeef.

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

	tests: disable tests for invalid msgctl and semctl commands on glibc >= 2.28
	Starting with commit glibc-2.32.9000-149-gbe9b0b9a012780a403a2,
	glibc skips msgctl syscall invocations and returns EINVAL
	for invalid msgctl commands.

	Likewise, starting with commit glibc-2.32.9000-147-ga16d2abd496bd974a882,
	glibc skips semctl syscall invocations and returns EINVAL
	for invalid semctl commands.

	These changes were later backported to vendor packages, e.g.:
	  * Thu Mar 18 2021 Carlos O'Donell <carlos@redhat.com> - 2.28-153
	  - Support SEM_STAT_ANY via semctl. Return EINVAL for unknown commands
	    to semctl, msgctl, and shmctl. (#1912670)

	* tests/ipc_msg.c [GLIBC_PREREQ_GE(2, 28)] (TEST_MSGCTL_BOGUS_CMD):
	Define to 0.
	* tests/ipc_sem.c [GLIBC_PREREQ_GE(2, 28)] (TEST_SEMCTL_BOGUS_CMD):
	Likewise.

2021-12-01  Dmitry V. Levin  <ldv@strace.io>

	upoken: workaround buggy process_vm_writev.
	The upoken implementation assumed that process_vm_writev could perform
	partial writes, but in older Linux kernel versions (my guess is in Linux
	before v3.15) process_vm_writev could not do partial writes properly.

	* src/ucopy.c (upoken): Fall back to upoken_pokedata when
	process_vm_writev fails with EFAULT or EIO.

2021-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	gcc_compat.h: bump required GCC version for diagnostic workarounds.
	Diagnostic push/pop pragmas were added only in gcc 4.6.

	* src/gcc_compat.h [!GNUC_PREREQ(4, 6)] (DIAG_PUSH_IGNORE_OVERRIDE_INIT,
	DIAG_POP_IGNORE_OVERRIDE_INIT, DIAG_PUSH_IGNORE_NONNULL,
	DIAG_POP_IGNORE_NONNULL): Define as empty.

2021-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	sttaic_assert: disable -Wnested-externs when the fallback is used.
	The fallback is only used with old compilers, and their diagnostics
	is less useful anyway.

	* src/static_assert.h [!HAVE_STATIC_ASSERT && !HAVE__STATIC_ASSERT &&
	__GNUC__]: Disable "-Wnested-externs" diagnostics.

2021-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests/sockaddr_xlat: explicitly nest anonymous union member initialisation
	Unfortunately, gcc 4.4.7 from RHEL 6 does not support designated
	initialisation of members of anonymous unions/structs without additional
	nesting brackets.

	* tests/sockaddr_xlat.c (check_ieee802154): Add curly brackets around
	short_addr/hwaddr field initialisation, prepend with pan_id field
	initialisation where needed.

	Complements: v5.14-167-g87ba9609f "sockaddr: implement decoding of AF_IEEE802154 socket addresses"

2021-11-30  Dmitry V. Levin  <ldv@strace.io>

	socketutils: fix protocol lookup in get_sockaddr_by_inode_lookup.
	If getfdproto() fails to obtain system.sockprotoname attribute,
	it returns SOCK_PROTO_UNKNOWN.  When this happens,
	get_sockaddr_by_inode_lookup() receives no hints about the protocol
	number and falls back to iterating over the protocols table.
	Apparently, it failed to implement this properly.

	* src/socketutils.c (get_sockaddr_by_inode_lookup): When iterating
	over protocols table, pass data from protocols[i] instead of
	protocols[SOCK_PROTO_UNKNOWN] to protocols[i].get().

	Fixes: v4.25~37 "socketutils: store more information in protocols table"

2021-11-29  Dmitry V. Levin  <ldv@strace.io>

	exec_or_die: fix race condition.
	* src/strace.c (exec_or_die): Repeat wait() invocation while it fails
	with EINTR.

	tests/count-f.c: fix race condition.
	* tests/count-f.c (main): Allow waitpid() to fail with EINTR.

	tests/attach-f-p.c: fix race condition.
	* tests/attach-f-p.c (thread): Allow read() to fail with EINTR.

2021-11-29  Dmitry V. Levin  <ldv@strace.io>

	m4: fix st_SELINUX check.
	* m4/st_selinux.m4: Make sure selinux support is enabled only if
	all expected functions are provided by libselinux.

	Fixes: v5.12~49 "Implement --secontext[=full] option to display SELinux contexts"

2021-11-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	NEWS: mention --decode-fds={socket,dev,pidfd} behaviour fix.
	Complements: v5.14-193-g8d83c8270 "Do not decode fd path unless --decode-fds=path is specified"

2021-11-29  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Document AT_FDCWD path decoding feature.
	* doc/strace.1.in (-e decode-fds, -y): Mention that current working
	directory is printed on AT_FDCWD occurrence in addition to fd path decoding.
	* NEWS: Mention it.

	Complements: v5.14-199-g48de116c2 "Print cwd path for AT_FDCWD when -y (--decode-fd=path) option is used"

2021-11-29  Renaud Métrich  <rmetrich@redhat.com>
	    Dmitry V. Levin  <ldv@strace.io>

	tests: check corner cases of AT_FDCWD path decoding.
	* tests/at_fdcwd-pathmax.c: New file.
	* tests/.gitignore: Add at_fdcwd-pathmax.
	* tests/pure_executables.list: Likewise.
	* tests/gen_tests.in (at_fdcwd-pathmax): New test.

2021-11-28  Renaud Métrich  <rmetrich@redhat.com>
	    Dmitry V. Levin  <ldv@strace.io>

	Print cwd path for AT_FDCWD when -y (--decode-fd=path) option is used.
	When syscalls use AT_FDCWD (e.g. openat()), the corresponding current
	working directory is not always obvious, one might need to search back
	for chdir() syscalls in the process or some of its parents.

	With this change, the current working directory corresponding to
	AT_FDCWD is printed when -y (--decode-fd=path) option is used, e.g.:

	openat(AT_FDCWD</home/rmetrich/GIT/strace>, "/lib64/libselinux.so.1" ...)

	* src/open.c: Include "number_set.h".
	(print_dirfd) <fd == AT_FDCWD>: Print the current working directory of
	tracee when DECODE_FD_PATH is set.
	* tests/dev-yy.c [!PRINT_AT_FDCWD_PATH] (PRINT_AT_FDCWD_PATH):
	New macro.
	(main): Update expected output.
	* tests/dev--decode-fds-all.c (PRINT_DEVNUM): New macro.
	Include "dev-yy.c" instead of "dev--decode-fds-dev.c".
	* tests/dev--decode-fds-dev.c (PRINT_AT_FDCWD_PATH): New macro.
	* tests/dev--decode-fds-path.c (PRINT_AT_FDCWD_PATH): Likewise.
	* tests/faccessat.c (AT_FDCWD_FMT, AT_FDCWD_ARG): New macros.
	(tests_with_existing_file, main): Update expected output.
	* tests/faccessat2.c (YFLAG): New macro.
	(main): Update expected output.
	* tests/fsconfig.c (test_fsconfig_set_path): Update expected output.
	* tests/fspick.c (main): Likewise.
	* tests/mount_setattr.c (main): Likewise.
	* tests/move_mount.c (main): Likewise.
	* tests/open_tree.c (main): Likewise.
	* tests/openat2.c (YFLAG, AT_FDCWD_FMT, AT_FDCWD_ARG): New macros.
	(main): Update expected output.

	Resolves: https://github.com/strace/strace/issues/194

2021-11-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	tests: fix bpf-obj_get_info_by_fd-prog-v expected output.
	Since we cannot reliably predict the value of xlated_prog_len field
	returned by the kernel, do not hard-code it.

	* tests/bpf-obj_get_info_by_fd.c (main): Print the value
	of the xlated_prog_len field returned by the kernel
	instead of hard-coding an expected value.

	Fixes: v5.14-46-g835c65c0e "bpf: fix bpf_prog_info.map_ids array printing"

2021-11-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	Make --decode-pids usage more in line with --decode-fds.
	Enable -e decode-pids syntax and document it in the man page.

	* src/filter_qualify.c (qual_options): Add "decode-pid" and "decode-pids"
	that associated with qualify_decode_pid decoder.
	* tests/options-syntax.test: Add option syntax checks for --decode-pids
	and -e decode-pids.
	* doc/strace.1.in (.BI "\-e " expr): Document decode-pids/decode-pid as
	a possible argument.
	(.SS Output format): Document -e decode-pids/--decode-pids.

	Complements: v5.14-184-gbac60e6a0 "Use traditional parser for --decode-pids option"

2021-11-28  Eugene Syromyatnikov  <evgsyr@gmail.com>

	src/strace.c: remove Yflag_qual.
	It is used only once, contrary to {y,q,t}flag_qual variables.

	* src/strace.c (init) <Yflag_qual>: Remove.
	(init) <case 'Y'>: Replace Yflag_qual with "comm" in the argument
	to qualify_decode_pid.

	Complements: v5.14-180-g255a59247 "Implement -Y/--decode-pids=comm option for printing command names for PIDs"

2021-11-28  Dmitry V. Levin  <ldv@strace.io>

	tests: remove ATTRIBUTE_ALLOC_SIZE from tail_alloc and tail_memdup.
	Many tests are intentionally feeding their target syscalls with garbage.
	Unfortunately, the compiler stands in the way, issuing tons of
	-Warray-bounds and -Wstringop-overread warnings when it is aware
	of the amount of memory allocated by tail_alloc and tail_memdup.

	* m4/st_broken_cc.m4: Remove.
	* configure.ac: Remove st_BROKEN_CC invocation.
	* tests/tests.h (tail_alloc, tail_memdup): Remove ATTRIBUTE_ALLOC_SIZE
	attribute.

	Resolves: https://github.com/strace/strace/issues/203

2021-11-28  Alex Xu (Hello71)  <alex_y_xu@yahoo.ca>

	tests: add shebang where necessary.
	musl does not implement the shell fallback for execvp, causing tests
	to fail.  It is also good practice to provide a shebang anyway.

	* tests/qual_fault-syscall.test: Add shebang.
	* tests/qual_inject-error-signal-syscall.test: Likewise.
	* tests/qual_inject-retval-syscall.test: Likewise.
	* tests/qual_inject-signal-syscall.test: Likewise.

	Resolves: https://github.com/strace/strace/issues/202

2021-11-27  Dmitry V. Levin  <ldv@strace.io>

	Do not decode fd path unless --decode-fds=path is specified.
	Before this change, --decode-fds with any argument would result to the
	file path corresponding to the file descriptor being printed even when
	the descriptor type does not match the type specified by the
	--decode-fds argument.  After this change, the file path corresponding
	to the file descriptor will be printed only when --decode-fds argument
	is not specified or contains "path".

	* src/util.c (print_quoted_string_in_angle_brackets): New function.
	(printfd_pid): Use it to print the file path when DECODE_FD_PATH is set.
	* tests/dev--decode-fds-all.c: New file.
	* tests/dev--decode-fds-none.c: Likewise.
	* tests/net--decode-fds-all-netlink.c: Likewise.
	* tests/pidfd_open--decode-fd-all.c: Likewise.
	* tests/pidfd_open--decode-fd-none.c: Likewise.
	* tests/dev--decode-fds-socket.c: Include "dev--decode-fds-none.c"
