Dmitry V. Levin [Mon, 9 May 2016 23:15:52 +0000 (23:15 +0000)]
strace-ff.test: check that -ff does not create unexpected output files
* tests/strace-ff.expected: New file.
* tests/Makefile.am (EXTRA_DIST): Add it.
* tests/strace-ff.test: Use it. Check that no other output files
have been created.
Dmitry V. Levin [Sat, 7 May 2016 23:11:52 +0000 (23:11 +0000)]
seccomp.c: use print_array function
* seccomp.c (decode_filter, decode_seccomp_fprog): Remove.
(print_bpf_filter): New function.
(print_seccomp_fprog): Use it via print_array.
* tests/seccomp-filter-v.c (main): Update.
Dmitry V. Levin [Sat, 7 May 2016 23:09:09 +0000 (23:09 +0000)]
poll.c: use print_array function
* poll.c (print_pollfd): Change for use as print_array callback.
(decode_poll_entering): Use print_array.
* tests/poll.c: Update.
* tests/poll.test: Update.
Dmitry V. Levin [Sat, 7 May 2016 23:02:36 +0000 (23:02 +0000)]
numa.c: use print_array function
* numa.c (print_node): New function.
(print_nodemask): Use it via print_array.
(print_page_array, print_int_array): Remove.
(print_addr): New function.
(print_status, print_int): Change for use as print_array callback.
(SYS_FUNC(move_pages)): Use print_addr, print_int, and print_status
via print_array.
* tests/move_pages.c: Update.
* tests/set_mempolicy.c: Likewise.
* tests/set_mempolicy.test: Likewise.
Dmitry V. Levin [Sat, 7 May 2016 22:49:39 +0000 (22:49 +0000)]
epoll.c: use print_array function
* epoll.c (print_epoll_event): Change signature for use as print_array
callback, all users updated.
(print_epoll_event_array): Remove.
(epoll_wait_common): Change to use print_array instead
of print_epoll_event_array.
Dmitry V. Levin [Sat, 7 May 2016 22:40:06 +0000 (22:40 +0000)]
aio.c: use print_array function
* aio.c (print_iocbp): New function.
(SYS_FUNC(io_submit)): Use it via print_array. Use widen_to_long
to process long int argument.
(print_io_event): Change to print struct io_event fetched elsewhere.
(SYS_FUNC(io_cancel)): Update use of print_io_event.
(SYS_FUNC(io_getevents)): Use print_io_event via print_array.
Use widen_to_long to print long int arguments.
* tests/aio.c (main): Check decoding of io_submit with negative "nr".
Dmitry V. Levin [Mon, 2 May 2016 22:06:56 +0000 (22:06 +0000)]
Mpersify ioctl macros
As values of some ioctl macros differ between personalities, these
personality specific ioctl macros should be properly defined for
mpersified code. Implement this by redefining personality specific
ioctl macros from ioctlent*.h for each file that includes MPERS_DEFS.
* Makefile.am (ioctl_macros_h): New variable.
(ioctl_macros%.h): New rule.
(BUILT_SOURCES, CLEANFILES): Add $(ioctl_macros_h).
(m%_type_defs.h): #include MPERS_$(mpers_PREFIX)IOCTL_MACROS.
* defs.h [HAVE_M32_MPERS] (MPERS_m32_IOCTL_MACROS): New macro.
[HAVE_MX32_MPERS] (MPERS_mx32_IOCTL_MACROS): Likewise.
Remove initialization of big holes in syscallent.h files
There is no need to explicitly initialize big holes after conversion
of syscallent.h files to use designated initializers. For architectures
that have some data at the end of syscallent.h this initialization of
big holes is no-op, for others it just inflates the table unnecessarily.
* linux/arc/syscallent.h: Remove initialization of arch specific block
at the end of table.
* linux/metag/syscallent.h: Likewise.
* linux/nios2/syscallent.h: Likewise.
* linux/or1k/syscallent.h: Likewise.
* linux/tile/syscallent.h: Likewise.
* linux/tile/syscallent1.h: Likewise.
* linux/arm/syscallent.h: Remove explicit initialization of a big hole
before socket subcalls.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/mips/syscallent-n32.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-compat.h: Remove explicit initialization
of big holes between different mips ABIs.
* linux/mips/syscallent-n64.h: Remove explicit initialization
of big holes before socket subcalls and between different mips ABIs.
* linux/mips/syscallent-o32.h: Likewise.
When #val_type directive is encountered, gen.sh starts using
XLAT_TYPE/XLAT_TYPE_PAIR macros instead of XLAT/XLAT_PAIR,
with #val_type's argument as a type.
For example, "#val_type uint64_t" means values of type uint64_t.
* xlat.h (XLAT_TYPE): New macro, similar to XLAT but casts
to the specified type instead of unsigned int.
(XLAT_TYPE_PAIR): New macro, similar to XLAT_PAIR but casts
to the specified type instead of unsigned int.
xlat: generate xlat pairs using new XLAT_PAIR macro
Before this change there were two forms of xlat entries: those that use XLAT
or XLAT_END macros, and others verbatim entries. This change converts
the latter to use new XLAT_PAIR macro.
This is necessary for the upcoming change of xlat.val type.
* xlat.h (XLAT_PAIR): New macro.
* xlat/gen.sh (cond_xlat, gen_header): Use it.
tests/remap_file_pages.c: fix for the upcoming change of xlat.val type
The "flags" argument of remap_file_page syscall has type "unsigned
long", so it is not correct to load most significant bits with garbage
ans assume they are going to be ignored.
* tests/remap_file_pages.c (main): Remove artificial garbage from flags.
This is necessary for the upcoming change of xlat.val type.
* defs.h (printflags): Rename to printflags64, change type of integer
argument to uint64_t.
(printflags): New static inline function.
* util.c (printflags): Rename to printflags64, change type of integer
argument to uint64_t. Print it using PRIx64 format.
Based on patch by Jeff Mahoney <jeffm@suse.com>.
This is necessary for the upcoming change of xlat.val type.
* defs.h (sprintflags): Rename to sprintflags64, change type of integer
argument to uint64_t.
(sprintflags): New static inline function.
* util.c (sprintflags): Rename to sprintflags64, change type of integer
argument to uint64_t. Print it using PRIx64 format.
Based on patch by Jeff Mahoney <jeffm@suse.com>.
printxvals: change type of integer argument to uint64_t
This is necessary for the upcoming change of xlat.val type.
All users of printxvals are already prepared for this change.
* defs.h (printxvals): Change type of integer argument to uint64_t.
* util.c (printxvals): Likewise. Print it using PRIx64 format.
Patch by Jeff Mahoney <jeffm@suse.com>.
xlat_search: change type of integer argument to uint64_t
This is necessary for the upcoming change of xlat.val type.
All users of addflags are already prepared for this change.
* defs.h (xlat_search): Change type of integer argument to uint64_t.
* util.c (xlat_search): Likewise. Pass it by pointer.
(xlat_bsearch_compare): Treat first argument as a pointer.
Patch by Jeff Mahoney <jeffm@suse.com>.
This is necessary for the upcoming change of xlat.val type.
* defs.h (xlookup): Rename to xlookup64, change type of integer argument
to uint64_t.
(xlookup): New static inline function.
* util.c (xlookup): Rename to xlookup64, change type of integer
argument to uint64_t.
Based on patch by Jeff Mahoney <jeffm@suse.com>.
addflags: change type of integer argument to uint64_t
This is necessary for the upcoming change of xlat.val type.
All users of addflags are already prepared for this change.
* defs.h (addflags): Change type of integer argument to uint64_t.
* util.c (addflags): Likewise. Print it using PRIx64 format.
Based on patch by Jeff Mahoney <jeffm@suse.com>.
* numa.c (get_nodes): Rewrite an rename to print_nodemask.
All callers updated.
(SYS_FUNC(mbind), SYS_FUNC(set_mempolicy), SYS_FUNC(get_mempolicy)):
Print a delimiter before nodemask argument.
alpha: fix decoding of osf_statfs and osf_fstatfs syscalls
Do not attempt to print struct osf_statfs as if it was the same as
struct statfs. Since struct osf_statfs has never been decoded properly,
it is probably too late to implement a decoder, so let's just print the
pointer.
statfs: print f_flags field only when ST_VALID flag is set
* statfs.c (print_statfs_flags): New function.
(printstatfs, printstatfs64, printcompat_statfs64): Use it.
* xlat/statfs_flags.in (ST_VALID): Move to the head of the list.
* tests/statfs.expected: Update.