]> granicus.if.org Git - strace/log
strace
9 years agoChange syscallent.h files to use designated initializers
Dmitry V. Levin [Sun, 11 Jan 2015 02:42:56 +0000 (02:42 +0000)]
Change syscallent.h files to use designated initializers

Automatically convert all linux syscallent.h files to a form that uses
designated initializers, with subsequent correction of whitespace
indentation.

* linux/alpha/syscallent.h: Use designated initializers.
* 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/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/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/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.

9 years agoCreate generic 32-bit syscallent.h
Dmitry V. Levin [Sun, 11 Jan 2015 01:04:54 +0000 (04:04 +0300)]
Create generic 32-bit syscallent.h

Since arc/syscallent.h, metag/syscallent.h, or1k/syscallent.h, and
tile/syscallent1.h share a lot of identical syscall entries described in
<asm-generic/unistd.h>, move these entries to a new file 32/syscallent.h
using the following automated conversion with subsequent correction of
whitespace indentation:

sed -e 's|^[[:space:]]*\({[^}]\+},\)[[:space:]]*/\*[[:space:]]\([[:space:]]*[0-9]\+\)[[:space:]]*\*/|[\2] = \1|' -e '/^[[:space:]]*\[[[:space:]]*2\(4[4-9]\|5[0-9]\)/d' linux/arc/syscallent.h

* linux/32/syscallent.h: New file.
* Makefile.am (EXTRA_DIST): Add it.
* linux/arc/syscallent.h: Include "32/syscallent.h",
remove generic 32-bit syscall entries, use designated initializers.
* linux/metag/syscallent.h: Likewise.
* linux/or1k/syscallent.h: Likewise.
* linux/tile/syscallent1.h: Likewise.

9 years agotile: fix syscall entries
Dmitry V. Levin [Sun, 11 Jan 2015 00:19:32 +0000 (03:19 +0300)]
tile: fix syscall entries

* linux/tile/syscallent1.h (truncate64, ftruncate64): Change nargs to 3.
(pread64, pwrite64): Change nargs to 5.
(llseek): Change sys_name to _llseek.

9 years agos390: fix fadvise64 and fadvise64_64 syscall entries
Dmitry V. Levin [Sun, 11 Jan 2015 00:15:24 +0000 (03:15 +0300)]
s390: fix fadvise64 and fadvise64_64 syscall entries

* linux/s390/syscallent.h (fadvise64, fadvise64_64): Change sys_func to
printargs until special parsers for 31-bit 31 s390 emulation wrappers
are written.

9 years agoalpha: fix fadvise64 syscall entry
Dmitry V. Levin [Sun, 11 Jan 2015 00:13:23 +0000 (03:13 +0300)]
alpha: fix fadvise64 syscall entry

* linux/alpha/syscallent.h (fadvise64): Change sys_name to fadvise64.

9 years agotile: fix fadvise64_64 syscall entry
Dmitry V. Levin [Sun, 11 Jan 2015 00:10:48 +0000 (03:10 +0300)]
tile: fix fadvise64_64 syscall entry

* linux/tile/syscallent1.h (fadvise64_64): Fix nargs, sys_func,
and sys_name.

9 years agoFix getrlimit and ugetrlimit syscall entries
Dmitry V. Levin [Sat, 10 Jan 2015 23:48:55 +0000 (02:48 +0300)]
Fix getrlimit and ugetrlimit syscall entries

* linux/arm/syscallent.h (getrlimit, ugetrlimit): Fix sys_name.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/avr32/syscallent.h (getrlimit): Fix sys_name.
* linux/or1k/syscallent.h: Likewise.
* linux/s390/syscallent.h (ugetrlimit): Fix sys_name.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.

9 years agoFix umount and umount2 syscall entries
Dmitry V. Levin [Sat, 10 Jan 2015 23:16:39 +0000 (02:16 +0300)]
Fix umount and umount2 syscall entries

* linux/aarch64/syscallent1.h (umount): Change nargs to 1.
* linux/avr32/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
* linux/ia64/syscallent.h (umount2): Change nargs to 2.
* linux/arm/syscallent.h (umount, umount2): Fix sys_name.
* linux/bfin/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/powerpc/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/metag/syscallent.h: (umount2): Fix sys_name.
* linux/or1k/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.

9 years agoFix sendfile64 syscall entries
Dmitry V. Levin [Sat, 10 Jan 2015 22:41:25 +0000 (01:41 +0300)]
Fix sendfile64 syscall entries

* linux/arc/syscallent.h (sendfile64): Change sys_name to sendfile64.
* linux/metag/syscallent.h: Likewise.
* linux/or1k/syscallent.h: Likewise.

9 years agoFix number of arguments in ipc family syscall entries
Dmitry V. Levin [Sat, 10 Jan 2015 20:51:40 +0000 (23:51 +0300)]
Fix number of arguments in ipc family syscall entries

* linux/64/syscallent.h (msgget, semget, semtimedop, semop, shmget,
shmctl, shmat, shmdt): Fix nargs for direct ipc syscalls.
* linux/alpha/syscallent.h (msgctl, msgget, msgrcv, semget, shmctl,
shmdt, shmget, semtimedop): Likewise.
* linux/avr32/syscallent.h (msgget, semget, semop, semtimedop, shmat,
shmget, shmdt, shmctl): Likewise.
* linux/bfin/syscallent.h (semget, semop, msgctl, msgget, msgrcv, shmat,
* shmctl, shmdt, shmget, semtimedop): Likewise.
* linux/hppa/syscallent.h (semop, semget, msgrcv, msgget, msgctl,
semtimedop): Likewise.
* linux/microblaze/syscallent.h (semtimedop, semget, semop, msgctl,
msgget, msgrcv, shmat, shmctl, shmdt, shmget): Likewise.
* linux/ia64/syscallent.h (semtimedop): Likewise.
* linux/mips/syscallent-n32.h (semtimedop): Likewise.
* linux/mips/syscallent-n64.h (semtimedop): Likewise.
* linux/or1k/syscallent.h (msgget, msgctl, msgrcv, semget, semtimedop,
semop, shmget, shmctl, shmat, shmdt): Likewise.
* linux/sh64/syscallent.h (semget, msgget, shmget): Likewise.
* linux/tile/syscallent1.h (msgget, semget, semtimedop, semop, shmget,
shmctl, shmat, shmdt): Likewise.
* linux/x32/syscallent.h (shmget, shmat, shmctl, semget, semop, shmdt,
msgget, semtimedop): Likewise.
* linux/x86_64/syscallent.h (shmget, shmat, shmctl, semget, semop,
shmdt, msgget, semtimedop): Likewise.
* linux/xtensa/syscallent.h (shmget, shmat, shmctl, shmdt, semtimedop,
semget, semop, msgget, msgrcv, msgctl): Likewise.

9 years agoCreate generic 64-bit syscallent.h
Dmitry V. Levin [Sat, 10 Jan 2015 17:51:37 +0000 (20:51 +0300)]
Create generic 64-bit syscallent.h

Since aarch64/syscallent1.h and tile/syscallent.h share a lot of
identical syscall entries described in <asm-generic/unistd.h>, move
these entries to a new file 64/syscallent.h using the following
automated conversion with subsequent correction of whitespace
indentation:

sed -e 's|^[[:space:]]*\({[^}]\+},\)[[:space:]]*/\*[[:space:]]\([[:space:]]*[0-9]\+\)[[:space:]]*\*/|[\2] = \1|' -e '/^\[[[:space:]]*2\(4[4-9]\|5[0-9]\)\]/d' linux/tile/syscallent.h

* linux/64/syscallent.h: New file.
* Makefile.am (EXTRA_DIST): Add it.
* linux/aarch64/syscallent1.h: Include "64/syscallent.h",
remove generic 64-bit syscall entries, use designated initializers.
* linux/tile/syscallent.h: Likewise.

9 years agoFix nfsservctl syscall entries
Dmitry V. Levin [Sat, 10 Jan 2015 17:07:37 +0000 (20:07 +0300)]
Fix nfsservctl syscall entries

* linux/arc/syscallent.h (nfsservctl): Set nargs, sys_func, and sys_name.
* linux/metag/syscallent.h: Likewise.

9 years agoAdd missing syscall entries for sched_[gs]etattr and renameat2
Dmitry V. Levin [Sat, 10 Jan 2015 16:45:08 +0000 (19:45 +0300)]
Add missing syscall entries for sched_[gs]etattr and renameat2

* linux/alpha/syscallent.h (sched_setattr, sched_getattr, renameat2):
New syscall entries.
* linux/arc/syscallent.h: Likewise.
* linux/metag/syscallent.h: Likewise.
* linux/or1k/syscallent.h: Likewise.
* linux/tile/syscallent.h: Likewise.
* linux/tile/syscallent1.h: Likewise.

9 years agoFix NUMA related syscall entries
Dmitry V. Levin [Sat, 10 Jan 2015 16:32:43 +0000 (19:32 +0300)]
Fix NUMA related syscall entries

* linux/alpha/syscallent.h (mbind, get_mempolicy, set_mempolicy):
Set sys_func.
* linux/hppa/syscallent.h (mbind, get_mempolicy, set_mempolicy):
Fix nargs, set sys_func.
* linux/microblaze/syscallent.h (mbind): Fix nargs.
* linux/mips/syscallent-n32.h (move_pages): Set sys_func.
* linux/mips/syscallent-n64.h (move_pages): Likewise.
* linux/mips/syscallent-o32.h (mbind): Fix nargs.
* linux/or1k/syscallent.h (migrate_pages): Likewise.
* linux/powerpc/syscallent.h (migrate_pages): Likewise.
* linux/sh/syscallent.h (mbind): Likewise.
* linux/sh64/syscallent.h (mbind): Likewise.

9 years agoxtensa: fix syscall entries
Dmitry V. Levin [Sat, 10 Jan 2015 16:12:11 +0000 (19:12 +0300)]
xtensa: fix syscall entries

* linux/xtensa/syscallent.h (sendmmsg): Fix sys_func and sys_name.
(restart_syscall, io_setup, io_destroy, io_submit, io_getevents,
io_cancel, add_key, request_key, keyctl): Set sys_func.
(migrate_pages, mbind, get_mempolicy, set_mempolicy, move_pages,
fstatat64): Fix nargs.
(renameat2): New entry.

9 years agoFix sched_setparam syscall entries
Dmitry V. Levin [Sat, 10 Jan 2015 05:28:06 +0000 (08:28 +0300)]
Fix sched_setparam syscall entries

* linux/aarch64/syscallent1.h (sched_setparam): Change nargs to 2.
* linux/arm/syscallent.h (sched_setparam): Likewise.
* linux/avr32/syscallent.h (sched_setparam): Likewise.
* linux/bfin/syscallent.h (sched_setparam): Likewise.
* linux/i386/syscallent.h (sched_setparam): Likewise.
* linux/m68k/syscallent.h (sched_setparam): Likewise.
* linux/microblaze/syscallent.h (sched_setparam): Likewise.
* linux/s390/syscallent.h (sched_setparam): Likewise.
* linux/s390x/syscallent.h (sched_setparam): Likewise.
* linux/sh/syscallent.h (sched_setparam): Likewise.
* linux/sh64/syscallent.h (sched_setparam): Likewise.
* linux/tile/syscallent.h (sched_setparam): Likewise.
* linux/tile/syscallent1.h (sched_setparam): Likewise.
* linux/x32/syscallent.h (sched_setparam): Likewise.
* linux/x86_64/syscallent.h (sched_setparam): Likewise.

9 years agoarc: fix fanotify_mark syscall entry
Dmitry V. Levin [Sat, 10 Jan 2015 05:02:12 +0000 (05:02 +0000)]
arc: fix fanotify_mark syscall entry

* linux/arc/syscallent.h (fanotify_mark): Change nargs to 6.

9 years agoia64: add fallocate syscall entry
Dmitry V. Levin [Sat, 10 Jan 2015 04:49:42 +0000 (04:49 +0000)]
ia64: add fallocate syscall entry

* linux/ia64/syscallent.h (fallocate): Add syscall entry.

9 years agoFix lookup_dcookie syscall entries
Dmitry V. Levin [Sat, 10 Jan 2015 04:40:29 +0000 (07:40 +0300)]
Fix lookup_dcookie syscall entries

* linux/s390/syscallent.h (lookup_dcookie): Add syscall entry.
* linux/s390x/syscallent.h (lookup_dcookie): Likewise.
* linux/tile/syscallent.h (lookup_dcookie): Change nargs to 3.
* linux/x32/syscallent.h (lookup_dcookie): Likewise.

9 years agoaarch64: fix syscall names for statfs, fstatfs, truncate, and ftruncate
Dmitry V. Levin [Sat, 10 Jan 2015 04:22:50 +0000 (07:22 +0300)]
aarch64: fix syscall names for statfs, fstatfs, truncate, and ftruncate

* linux/aarch64/syscallent1.h (statfs, fstatfs, truncate, ftruncate):
Use correct syscall names.

9 years agoaarch64: fix mlock syscall entry
Dmitry V. Levin [Sat, 10 Jan 2015 03:53:45 +0000 (03:53 +0000)]
aarch64: fix mlock syscall entry

* linux/aarch64/syscallent1.h (mlock): Change to mlock entry.

9 years agosh, sh64: fix mlock syscall entry
Dmitry V. Levin [Sat, 10 Jan 2015 03:51:03 +0000 (03:51 +0000)]
sh, sh64: fix mlock syscall entry

* linux/sh/syscallent.h (mlock): Change nargs to 2.
* linux/sh64/syscallent.h (mlock): Likewise.

9 years agotile: fix swapon syscall entries
Dmitry V. Levin [Sat, 10 Jan 2015 03:48:15 +0000 (03:48 +0000)]
tile: fix swapon syscall entries

* linux/tile/syscallent.h (swapon): Change nargs to 2.
* linux/tile/syscallent1.h (swapon): Likewise.

9 years agoARM EABI: reserve some space for new syscalls
Dmitry V. Levin [Sun, 11 Jan 2015 17:35:37 +0000 (17:35 +0000)]
ARM EABI: reserve some space for new syscalls

Reserve the same space for new syscalls on EABI as it is already
reserved on OABI.

* linux/arm/syscallent.h [__ARM_EABI__] (ARM_FIRST_SHUFFLED_SYSCALL):
Raise to 400.

9 years agoarm: rewrite shuffle_scno in a bit more readable way
Dmitry V. Levin [Sun, 11 Jan 2015 17:26:29 +0000 (17:26 +0000)]
arm: rewrite shuffle_scno in a bit more readable way

* linux/arm/syscallent.h: Define ARM_FIRST_SHUFFLED_SYSCALL instead of
ARM_LAST_ORDINARY_SYSCALL.
* syscall.c [ARM || AARCH64] (shuffle_scno): Update.

9 years agotests: add tests for ipc syscalls decoding
Dmitry V. Levin [Mon, 12 Jan 2015 16:08:59 +0000 (16:08 +0000)]
tests: add tests for ipc syscalls decoding

* tests/ipc_msg.c: New file.
* tests/ipc_sem.c: Likewise.
* tests/ipc_shm.c: Likewise.
* tests/ipc_msg.test: New test.
* tests/ipc_sem.test: Likewise.
* tests/ipc_shm.test: Likewise.
* tests/Makefile.am (check_PROGRAMS): Add ipc_msg, ipc_sem, and ipc_shm.
(TESTS): Add ipc_msg.test, ipc_sem.test, and ipc_shm.test.
* tests/.gitignore: Add ipc_msg, ipc_sem, and ipc_shm.

9 years agoFix indirect ipc subcall handling
Dmitry V. Levin [Sat, 10 Jan 2015 19:01:35 +0000 (22:01 +0300)]
Fix indirect ipc subcall handling

indirect_ipccall used to guess whether currently decoded ipc syscall is
an indirect subcall or not based on generic knowledge, while there is a
robust method to identify indirect ipc subcalls.

* defs.h (TRACE_INDIRECT_SUBCALL): New flag.
* ipc.c (indirect_ipccall): Check it.
* linux/subcall.h: Set it.

9 years agoMove socket and ipc subcall entries to subcall.h
Dmitry V. Levin [Sun, 11 Jan 2015 13:56:40 +0000 (13:56 +0000)]
Move socket and ipc subcall entries to subcall.h

Syscall entries for socket and ipc subcalls are the same on all
architectures, or at least they should be the same, so move them
to the single file.

* linux/subcall.h: Add syscall entries for socket and ipc subcalls.
* linux/arm/syscallent.h: Remove entries for socket and ipc subcalls.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/powerpc/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.

9 years agosh: fix typo introduced by commit v4.9-121-gd535b8b
Dmitry V. Levin [Sat, 10 Jan 2015 00:40:10 +0000 (00:40 +0000)]
sh: fix typo introduced by commit v4.9-121-gd535b8b

* linux/sh/syscallent.h (getresgid32): Fix typo in sys_func and sys_name.

9 years agoFix fanotify_mark decoding on 32-bit architectures
Dmitry V. Levin [Sat, 10 Jan 2015 00:08:58 +0000 (00:08 +0000)]
Fix fanotify_mark decoding 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.

* configure.ac (AC_CHECK_FUNCS): Add fanotify_mark.
(AC_CHECK_HEADERS): Add sys/fanotify.h.
* defs.h (getllval): New prototype.
* util.c (getllval): New function based on printllval.
(printllval): Use getllval.
* fanotify.c (sys_fanotify_mark): Use getllval to properly decode
64-bit mask and two syscall arguments followed by it.
* tests/fanotify_mark.c: New file.
* tests/fanotify_mark.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add fanotify_mark.
(TESTS): Add fanotify_mark.test.
* tests/.gitignore: Add fanotify_mark.

9 years agov4l2: fix build on systems with older kernel headers
Dmitry V. Levin [Fri, 9 Jan 2015 04:53:19 +0000 (04:53 +0000)]
v4l2: fix build on systems with older kernel headers

* v4l2.c (print_v4l2_format_fmt): Do not use
V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY unless it is defined.
(v4l2_ioctl): Do not use VIDIOC_ENUM_FRAMESIZES and
VIDIOC_ENUM_FRAMEINTERVALS unless they are defined.

9 years agotests: fix build with awk that does not support switch-case
Dmitry V. Levin [Fri, 9 Jan 2015 04:10:54 +0000 (04:10 +0000)]
tests: fix build with awk that does not support switch-case

The switch-case statement is a gawk-specific feature which is not
necessarily available, let's use traditional if-else statements instead.

* tests/uid.awk: Rewrite without switch-case statements.

9 years agoFix build on systems that lack O_CLOEXEC definition
Dmitry V. Levin [Fri, 9 Jan 2015 03:47:23 +0000 (03:47 +0000)]
Fix build on systems that lack O_CLOEXEC definition

* xlat/timerfdflags.in [!TFD_CLOEXEC]: Check that O_CLOEXEC is defined.

9 years agoFix build on systems that lack NETLINK_SOCK_DIAG definition
Dmitry V. Levin [Fri, 9 Jan 2015 03:03:39 +0000 (03:03 +0000)]
Fix build on systems that lack NETLINK_SOCK_DIAG definition

NETLINK_INET_DIAG was introduced in linux v2.6.14,
NETLINK_SOCK_DIAG was added much later in linux v3.3.

* net.c [!NETLINK_SOCK_DIAG && NETLINK_INET_DIAG]
(NETLINK_SOCK_DIAG): Define.
* socketutils.c: Likewise.
* tests/netlink_unix_diag.c: Likewise.

9 years agoCleanup local copy of linux/fanotify.h
Dmitry V. Levin [Fri, 9 Jan 2015 02:18:03 +0000 (02:18 +0000)]
Cleanup local copy of linux/fanotify.h

* linux/fanotify.h: Remove macros and structures not used by
fanotify_init and fanotify_mark parsers.

9 years agoFix "make dist" regression introduced by commit v4.9-125-g120e5db
Dmitry V. Levin [Fri, 9 Jan 2015 02:02:39 +0000 (02:02 +0000)]
Fix "make dist" regression introduced by commit v4.9-125-g120e5db

* Makefile.am (EXTRA_DIST): Add linux/unix_diag.h.

9 years agotests: fix build with fresh glibc
Dmitry V. Levin [Thu, 8 Jan 2015 22:29:12 +0000 (22:29 +0000)]
tests: fix build with fresh glibc

* tests/netlink_unix_diag.c: Include <stdint.h>.

9 years agoioctlent.sh: handle linux/aufs_type.h properly
Dmitry V. Levin [Thu, 8 Jan 2015 19:11:05 +0000 (19:11 +0000)]
ioctlent.sh: handle linux/aufs_type.h properly

Before this change, ioctlent.sh could not recognize unusual constants
defined by linux/aufs_type.h, resulting to ioctls.h with references to
these constants without appropriate definitions in ioctldefs.h.

* linux/ioctlent.sh: Update the regexp that is used to lookup constants
referenced by generated ioctls.h.

9 years agotests: fix distcheck
Dmitry V. Levin [Thu, 8 Jan 2015 18:46:30 +0000 (18:46 +0000)]
tests: fix distcheck

* tests/stat32-v.test: Remove work files if the test is skipped.

9 years agoFix printing of time_t values set in the distant future
Dmitry V. Levin [Thu, 8 Jan 2015 15:08:16 +0000 (15:08 +0000)]
Fix printing of time_t values set in the distant future

* util.c (sprinttime): Increase buffer size.
* tests/stat64-v.test: Try to set modification time of the sample file
to a value set in the distant future.

9 years agoUse AC_CHECK_TYPES to check for struct statfs64
Dmitry V. Levin [Thu, 8 Jan 2015 04:12:29 +0000 (04:12 +0000)]
Use AC_CHECK_TYPES to check for struct statfs64

* m4/statfs.m4: Remove.
* configure.ac (AC_STATFS64): Remove.
(AC_CHECK_TYPES): Add struct statfs64.
* statfs.c: Replace HAVE_STATFS64 with HAVE_STRUCT_STATFS64.

9 years agoUse AC_CHECK_TYPES to check for struct stat64
Dmitry V. Levin [Thu, 8 Jan 2015 04:06:06 +0000 (04:06 +0000)]
Use AC_CHECK_TYPES to check for struct stat64

* m4/stat.m4: Remove.
* configure.ac (AC_STAT64): Remove.
(AC_CHECK_TYPES): Add struct stat64.
* file.c: Replace HAVE_STAT64 with HAVE_STRUCT_STAT64.

9 years agofile.c: fix 32-bit stat decoding on 64-bit architectures
Dmitry V. Levin [Tue, 30 Dec 2014 11:18:47 +0000 (11:18 +0000)]
file.c: fix 32-bit stat decoding on 64-bit architectures

* file.c [SPARC || SPARC64] (struct stat): Remove, use generic
definition from <asm/stat.h>.
[SPARC64] (struct stat_sparc64, printstat_sparc64): Remove.
[AARCH64 || X86_64 || X32 || POWERPC64 || SPARC64] (struct stat32,
STAT32_PERSONALITY): Define.
[STAT32_PERSONALITY] (struct stat_powerpc32): Rename to struct stat32.
[STAT32_PERSONALITY] (printstat_powerpc32): Rename to printstat32.
(printstat) [STAT32_PERSONALITY]: Call printstat32 when
current_personality == STAT32_PERSONALITY.
[HAVE_STAT64] (printstat64) [STAT32_PERSONALITY]: Call printstat when
current_personality != STAT32_PERSONALITY.
[!HAVE_STAT64] (sys_stat64): Fallback to sys_stat.
[!HAVE_STAT64] (sys_fstat64): Fallback to sys_fstat.

9 years agosparc: reuse struct stat parser code for struct solstat decoding
Dmitry V. Levin [Thu, 8 Jan 2015 03:13:59 +0000 (03:13 +0000)]
sparc: reuse struct stat parser code for struct solstat decoding

* printstat.h: Parametrize major() and minor().
* file.c [SPARC || SPARC64]: Define do_printstat_sol by instantiating
printstat.h template.
[SPARC || SPARC64] (printstatsol): Use do_printstat_sol.

9 years agoppc64: reuse struct stat parser code for struct stat_powerpc32 decoding
Dmitry V. Levin [Thu, 8 Jan 2015 02:59:04 +0000 (02:59 +0000)]
ppc64: reuse struct stat parser code for struct stat_powerpc32 decoding

* file.c [POWERPC64]: Define do_printstat32 by instantiating printstat.h
template.
[POWERPC64] (printstat_powerpc32): Use do_printstat32.

9 years agofile.c: group related parsers together
Dmitry V. Levin [Thu, 8 Jan 2015 01:14:53 +0000 (01:14 +0000)]
file.c: group related parsers together

* file.c (sys_stat, sys_fstat): Collect in one place right before
the definition of printstat64.
(sys_stat64, sys_fstat64): Collect in one place right after the
definition of printstat64.

9 years agofile.c: collect scattered __old_kernel_stat related code
Dmitry V. Levin [Sun, 28 Dec 2014 19:10:58 +0000 (19:10 +0000)]
file.c: collect scattered __old_kernel_stat related code

* file.c [HAVE_STRUCT___OLD_KERNEL_STAT] (convertoldstat, printoldstat,
sys_oldstat, sys_oldfstat): Collect functions in one place.

9 years agoUse the same source code for struct stat/stat64 decoding
Dmitry V. Levin [Sun, 28 Dec 2014 18:56:23 +0000 (18:56 +0000)]
Use the same source code for struct stat/stat64 decoding

* file.c: Define do_printstat64 by instantiating printstat.h template.
(printstat64): Use do_printstat64.

9 years agox32: use generic printstat/printstat64 parsers
Dmitry V. Levin [Sun, 28 Dec 2014 18:41:20 +0000 (21:41 +0300)]
x32: use generic printstat/printstat64 parsers

* file.c (printstat) [X32]: Define.
(printstat64) [X32]: Use "struct stat64" instead of "struct stat".
Use printstat for x32 personality processes.
(printstat64_x32): Remove.
(sys_stat64, sys_fstat64) [X32]: Use printstat64 instead of
printstat64_x32.

9 years agox32: remove redundant definitions
Dmitry V. Levin [Sun, 28 Dec 2014 16:41:24 +0000 (16:41 +0000)]
x32: remove redundant definitions

* file.c [X32]: Do not define "struct stat" and "struct
__old_kernel_stat" locally, use definitions provided by <asm/stat.h>.
Do not define "struct stat64" exclusively, reuse another definition
added earlier for X86_64.

9 years agoConvert do_printstat to a template function
Dmitry V. Levin [Sun, 28 Dec 2014 18:15:25 +0000 (18:15 +0000)]
Convert do_printstat to a template function

* printstat.h: New file.
* Makefile.am (strace_SOURCES): Add it.
* file.c: Include "printstat.h".
(do_printstat): Move to printstat.h, parametrize its name
and struct stat.

9 years agofile.c: prepare realprintstat for parametrization
Dmitry V. Levin [Sun, 28 Dec 2014 18:00:39 +0000 (18:00 +0000)]
file.c: prepare realprintstat for parametrization

* file.c (realprintstat): Adjust format strings so that all 64-bit
integer fields are printed with %llu format, and %u format is used for
all the rest.  Rename to do_printstat.
(printstat, printoldstat): Update callers.

9 years agotests: cleanup stat.test
Dmitry V. Levin [Thu, 8 Jan 2015 00:32:35 +0000 (00:32 +0000)]
tests: cleanup stat.test

* tests/stat.test: Rewrite in a more readable way.

9 years agotests: check verbose decoding of 32-bit and 64-bit struct stat
Dmitry V. Levin [Wed, 7 Jan 2015 19:30:37 +0000 (19:30 +0000)]
tests: check verbose decoding of 32-bit and 64-bit struct stat

* tests/stat.c: New file.
* tests/stat32.c: Likewise.
* tests/stat32-v.test: New file.
* tests/stat64-v.test: Likewise.
* tests/Makefile.am (check_PROGRAMS): Add stat and stat32.
(stat_CFLAGS): Define.
(TESTS): Add stat32-v.test and stat64-v.test.
* tests/.gitignore: Add stat and stat32.

9 years agoCleanup struct stat.st_flags decoding
Dmitry V. Levin [Sun, 28 Dec 2014 17:44:13 +0000 (17:44 +0000)]
Cleanup struct stat.st_flags decoding

There are no symbolic constants defined for struct stat.st_flags,
so decode this rare field as unsigned int.

* xlat/fileflags.in: Remove.
* file.c (realprintstat, printstat64) [HAVE_STRUCT_STAT_ST_FLAGS]:
Decode struct stat.st_flags as unsigned int.

9 years agoDrop struct stat.st_aclcnt and stat.st_level support
Dmitry V. Levin [Sun, 28 Dec 2014 17:27:33 +0000 (17:27 +0000)]
Drop struct stat.st_aclcnt and stat.st_level support

Remove the code that supports struct stat.st_aclcnt and stat.st_level
decoding -- these fields are not defined in system headers.

* configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_aclcnt and
struct stat.st_level.
* file.c (realprintstat, printstat64)
[HAVE_STRUCT_STAT_ST_ACLCNT || HAVE_STRUCT_STAT_ST_LEVEL]: Remove.

9 years agotests: fix race condition in net-accept-connect based tests
Dmitry V. Levin [Wed, 7 Jan 2015 20:14:19 +0000 (20:14 +0000)]
tests: fix race condition in net-accept-connect based tests

Change all net-accept-connect based tests to use different unix domain
socket addresses, so that these tests could be safely run in parallel.

* tests/net-accept-connect.c: Parametrize unix domain socket address.
* tests/net-fd.test: Pass socket address to net-accept-connect.
* tests/net.test: Likewise.
* tests/unix-yy.test: Likewise.
* tests/unix-yy-accept.awk: Update regexps.
* tests/unix-yy-connect.awk: Likewise.

9 years agotimerfd: update flags decoding
Mike Frysinger [Wed, 31 Dec 2014 00:08:50 +0000 (19:08 -0500)]
timerfd: update flags decoding

The current code only decodes TFD_TIMER_ABSTIME when the kernel has
a bunch of newer flags.  We have to handle fallbacks for all of them
since the kernel doesn't currently export things to userspace.

* time.c: Include fcntl.h for O_* defines.
(TFD_TIMER_ABSTIME): Move to xlat/timerfdflags.in.
* xlat/timerfdflags.in: Add more definitions.

9 years agosparc: fix fxstat decoding
Dmitry V. Levin [Mon, 29 Dec 2014 03:15:42 +0000 (03:15 +0000)]
sparc: fix fxstat decoding

* file.c [SPARC || SPARC64] (sys_fxstat): Print file descriptor
using printfd.

9 years agosparc: drop _STAT64_VER support
Dmitry V. Levin [Mon, 29 Dec 2014 03:08:53 +0000 (03:08 +0000)]
sparc: drop _STAT64_VER support

Starting with commit v4.6-240-g5afdf12, nobody compiles this
non-Linux code.

* file.c [SPARC || SPARC64] (sys_xstat, sys_fxstat): Remove
_STAT64_VER code.

9 years agosparc: remove redundant sys_lxstat
Dmitry V. Levin [Mon, 29 Dec 2014 03:04:11 +0000 (03:04 +0000)]
sparc: remove redundant sys_lxstat

* file.c [SPARC || SPARC64] (sys_lxstat): Remove.
* linux/sparc/dummy2.h (solaris_lxstat): Alias to sys_xstat.
* linux/sparc64/dummy2.h (solaris_lxstat): Likewise.

9 years agofile.c: do not include unused headers
Dmitry V. Levin [Sun, 28 Dec 2014 15:24:21 +0000 (15:24 +0000)]
file.c: do not include unused headers

* file.c: Do not include <fcntl.h>.

9 years agoCleanup UTIME_NOW/UTIME_OMIT decoding
Dmitry V. Levin [Fri, 26 Dec 2014 23:55:38 +0000 (23:55 +0000)]
Cleanup UTIME_NOW/UTIME_OMIT decoding

Move the code that's present in two copies from sprinttv()
to a new helper function.

* time.c (do_sprinttv): New function.
(sprinttv): Use it.

9 years agoFix UTIME_NOW/UTIME_OMIT decoding
Elliott Hughes [Tue, 23 Dec 2014 18:42:40 +0000 (10:42 -0800)]
Fix UTIME_NOW/UTIME_OMIT decoding

The kernel doesn't actually care what tv_sec is set to --- it only checks
tv_nsec when looking for the special values.

9 years agoMake -yy output for inet sockets consistent with unix domain sockets
Dmitry V. Levin [Fri, 26 Dec 2014 23:29:26 +0000 (23:29 +0000)]
Make -yy output for inet sockets consistent with unix domain sockets

Prepend -yy output generated for INET/INET6 TCP/UDP sockets with their
protocol name obtained using getxattr.

* socketutils.c (inet_parse_response): Add proto_name argument.
Print proto_name for connected and unconnected sockets.
(receive_responses): Add proto_name argument, pass it to the parser.
(inet_print): Add proto_name argument, pass it to receive_responses.
(unix_parse_response): Add proto_name argument.
(print_sockaddr_by_inode): Pass protocol name to inet_print calls.
* tests/net-yy-accept.awk: Update to match new output format.
* tests/net-yy-connect.awk: Likewise.

9 years agotests: robustify unix domain socket decoding test
Dmitry V. Levin [Thu, 25 Dec 2014 00:32:23 +0000 (00:32 +0000)]
tests: robustify unix domain socket decoding test

Unix domain socket address family name is not universally decoded as
AF_LOCAL, other names like AF_UNIX and AF_FILE are valid synonyms.
Similarly, PF_UNIX and PF_FILE are valid synonyms for PF_LOCAL.

Some test regexps have to be properly initialized before they could
be used, so make sure they are initialized before use.

9 years agotests: fix unix domain socket decoding availability test
Dmitry V. Levin [Thu, 25 Dec 2014 00:11:40 +0000 (00:11 +0000)]
tests: fix unix domain socket decoding availability test

Since inet_diag and unix_diag interfaces are implemented by different
kernel modules, they have to be tested separately.

* tests/netlink_unix_diag.c: New file.
* tests/unix-yy.test: Use it.
* tests/Makefile.am (check_PROGRAMS): Add it.
* tests/.gitignore: Likewise.

9 years agotests: add a test for decoding unix domain socket addresses
Masatake YAMATO [Wed, 24 Dec 2014 11:59:32 +0000 (20:59 +0900)]
tests: add a test for decoding unix domain socket addresses

* tests/unix-yy-accept.awk: New file.
* tests/unix-yy-connect.awk: New file.
* tests/unix-yy.test: New test.
* tests/Makefile.am (TESTS): Add it.
(EXTRA_DIST): Add unix-yy-accept.awk and unix-yy-connect.awk.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
9 years agoSupport unix domain sockets in -yy option
Masatake YAMATO [Wed, 24 Dec 2014 11:59:31 +0000 (20:59 +0900)]
Support unix domain sockets in -yy option

This change extends -yy option to handle unix domain sockets:
their peer addresses will be printed, similar to inet sockets.

For a listening socket, its socket inode and socket path are printed.
For an accepted socket, its socket inode, the peer inode, and the
socket path are printed.
For a client socket, its socket inode and the peer inode are printed.

An example of a server side communication using netcat:

$ ./strace -yy -e network nc -l -U /tmp/example.sock
socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
setsockopt(3<UNIX:[14728348]>, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(3<UNIX:[14728348]>, {sa_family=AF_LOCAL, sun_path="/tmp/example.sock"}, 19) = 0
listen(3<UNIX:[14728348,"/tmp/example.sock"]>, 10) = 0
accept(3<UNIX:[14728348,"/tmp/example.sock"]>, {sa_family=AF_LOCAL, NULL}, [2]) = 4<UNIX:[14727246->14727245,"/tmp/example.sock"]>
recvfrom(4<UNIX:[14727246->14727245,"/tmp/example.sock"]>, "INPUT\n", 8192, 0, NULL, NULL) = 6
INPUT

An example of a client side communication using netcat:

$ ./strace -yy -e network nc -U /tmp/example.sock
socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
connect(3<UNIX:[14727245]>, {sa_family=AF_LOCAL, sun_path="/tmp/example.sock"}, 19) = 0
getsockopt(3<UNIX:[14727245]>, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
INPUT
...
sendto(3<UNIX:[14727245->14727246]>, "INPUT\n", 6, 0, NULL, 0) = 6

* linux/unix_diag.h: New file.
* socketutils.c (send_query): Rename to inet_send_query.
(parse_response): Rename to inet_parse_response.
(unix_print, unix_send_query, unix_parse_response): New functions.
(receive_responses): Add a new argument named parser: a function for
handling protocol specific data parts of diag messages.
(print_sockaddr_by_inode): Call unix_print.
Replace NETLINK_INET_DIAG with NETLINK_SOCK_DIAG, they are equal
but NETLINK_SOCK_DIAG looks more generic.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
9 years agoUse the protocol name of a socket as a hint for peer address resolution
Masatake YAMATO [Wed, 10 Dec 2014 03:55:06 +0000 (12:55 +0900)]
Use the protocol name of a socket as a hint for peer address resolution

To resolve the peer address of socket, all combinations of families
(AF_INET, AF_INET6) and protocols(IPPROTO_TCP, IPPROTO_UDP) were tried.
This change utilizes the protocol name obtained via getxattr to specify
the right combination.

* socketutils.c (inet_print): New helper function.
(print_sockaddr_by_inode): Use it.  Utilize the protocol name
associated with the given inode for resolving the peer socket
address.  If the protocol name is NULL, resolve the address
by trying combinations of families and protocols as before.
* defs.h (print_sockaddr_by_inode): Update prototype.
* util.c (printfd): Pass the protocol name associated with
the given path to print_sockaddr_by_inode as the 2nd argument.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
9 years agoFix decoding of getgroups, getgroups32, setgroups, and setgroups32 syscalls
Dmitry V. Levin [Sun, 14 Dec 2014 13:30:54 +0000 (13:30 +0000)]
Fix decoding of getgroups, getgroups32, setgroups, and setgroups32 syscalls

Convert parsers of these syscalls to the same scheme as were applied to
parsers of other uid/gid related syscalls.
That is, define two sets of parsers on architectures that support
(either directly or via multiarch) 16-bit and 32-bit gid getgroups
and setgroups syscalls simultaneously, and reuse essentially the same
code by parametrizing uid_t and names of parser functions.

* groups.c: Remove.
(sys_getgroups, sys_setgroups): Move ...
* uid.c: ... here and parametrize their names.
* Makefile.am (strace_SOURCES): Remove groups.c.
* linux/syscall.h (sys_getgroups32, sys_setgroups32): Remove.
[NEED_UID16_PARSERS] (sys_getgroups16, sys_setgroups16): New prototypes.
* linux/arm/syscallent.h: Rename sys_[gs]etgroups to sys_[gs]etgroups16,
rename sys_[gs]etgroups32 to sys_[gs]etgroups.
* linux/bfin/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* tests/uid.c: Test for getgroups.
* tests/uid16.c: Likewise.
* tests/uid32.c: Test for getgroups32.
* tests/uid.awk: Test for getgroups/getgroups32 decoding.
* tests/uid.test: Trace getgroups/getgroups32 syscalls.

9 years agoFix decoding of 16-bit *chown and [gs]et*[gu]id syscalls
Dmitry V. Levin [Sat, 13 Dec 2014 21:49:01 +0000 (21:49 +0000)]
Fix decoding of 16-bit *chown and [gs]et*[gu]id syscalls

Define two sets of parsers on architectures that support (either
directly or via multiarch) 16-bit and 32-bit uid/gid syscalls
simultaneously.  Since the code in these two sets is essentially
the same and the key difference between them is the size of uid_t,
implement it by parametrizing uid_t and names of parser functions.

* defs.h (NEED_UID16_PARSERS): New macro.
* linux/syscall.h [NEED_UID16_PARSERS] (sys_chown16, sys_fchown16,
sys_getresuid16, sys_getuid16, sys_setfsuid16, sys_setresuid16,
sys_setreuid16, sys_setuid16): New prototypes.
* linux/dummy.h (sys_geteuid16): Alias to sys_getuid16.
(sys_getegid16, sys_getgid16, sys_getresgid16, sys_setfsgid16,
sys_setgid16, sys_setregid16, sys_setresgid16): Alias to corresponding
sys_*uid16 functions.
* uid.c: Stop including <asm/posix_types.h>.
Parametrize uid_t and names of all exported functions.
(get_print_uid): New function.
(sys_getresuid): Use it.
(printuid): Check for (uid_t) -1.
* uid16.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/arm/syscallent.h: Use sys_chown16, sys_fchown16, sys_getegid16,
sys_geteuid16, sys_getgid16, sys_getresgid16, sys_getresuid16,
sys_getuid16, sys_setfsgid16, sys_setfsuid16, sys_setgid16,
sys_setregid16, sys_setresgid16, sys_setresuid16, sys_setreuid16,
and sys_setuid16 parsers for *chown and [gs]et*[gu]id syscall entries.
* linux/bfin/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* tests/uid16.c: New file.
* tests/uid16.test: New test.
* tests/Makefile.am (CHECK_PROGRAMS): Add uid16.
(TESTS): Add uid16.test.
* tests/.gitignore: Add uid16.

9 years agosh, sh64: fix uid/gid syscall entries
Dmitry V. Levin [Tue, 16 Dec 2014 00:31:53 +0000 (00:31 +0000)]
sh, sh64: fix uid/gid syscall entries

* linux/sh/syscallent.h: Replace printargs with real syscall
parsers in *chown32 and [gs]et*[gu]id32 syscall entries.
* linux/sh64/syscallent.h: Likewise.

9 years agos390: fix uid/gid syscall entries
Dmitry V. Levin [Tue, 16 Dec 2014 00:41:50 +0000 (00:41 +0000)]
s390: fix uid/gid syscall entries

* linux/s390/syscallent.h: Add "32" suffix to names of *chown32
and [gs]et*[gu]id32 syscalls #198..216.

9 years agosparc: fix uid/gid syscall entries
Dmitry V. Levin [Tue, 16 Dec 2014 00:25:36 +0000 (00:25 +0000)]
sparc: fix uid/gid syscall entries

* linux/sparc/syscallent.h: Add "32" suffix to names
of [gs]etres[gu]id32 syscalls #108..112.
Fix entry for syscall #112 from setresgid32 to setregid32.

9 years agochown.c: split into separate files
Dmitry V. Levin [Sat, 13 Dec 2014 16:20:44 +0000 (16:20 +0000)]
chown.c: split into separate files

This will make further uid/gid fixes simpler.

* fchownat.c: New file.
* chown.c (sys_fchownat: Move to fchownat.c.
(sys_chown, sys_fchown): Move to uid.c.
* Makefile.am (strace_SOURCES): Remove chown.c, add fchownat.c.

9 years agoutil.c: move printuid to uid.c
Dmitry V. Levin [Sat, 13 Dec 2014 16:02:22 +0000 (16:02 +0000)]
util.c: move printuid to uid.c

This will make further uid/gid fixes simpler.

* util.c (printuid): Move
* uid.c: ... here.

9 years agotests/uid.awk: rewrite in a more maintainable style
Dmitry V. Levin [Mon, 15 Dec 2014 23:44:31 +0000 (23:44 +0000)]
tests/uid.awk: rewrite in a more maintainable style

Since the test is virtually a FSM, rewrite it as a FSM.

9 years agoprintuid: fix uid_t decoding on 64-bit architectures
Dmitry V. Levin [Sat, 13 Dec 2014 18:24:13 +0000 (18:24 +0000)]
printuid: fix uid_t decoding on 64-bit architectures

It was not a good idea to treat uid_t as a long int type because
the latter is twice larger than uid_t on 64-bit architectures.

* defs.h (printuid): Change uid argument type from "unsigned long"
to "unsigned int".
* util.c (printuid): Likewise.  When uid equals to -1, print "-1".
* tests/uid.awk: New file.
* tests/uid.c: New file.
* tests/uid32.c: Likewise.
* tests/uid.test: New test.
* tests/uid32.test: Likewise.
* tests/Makefile.am (CHECK_PROGRAMS): Add uid and uid32.
(TESTS): Add uid.test and uid32.test.
(EXTRA_DIST): Add uid.awk.
* tests/.gitignore: Add uid and uid32.

9 years agoUpdate PTRACE_* constants
Dmitry V. Levin [Sat, 13 Dec 2014 01:56:56 +0000 (01:56 +0000)]
Update PTRACE_* constants

* xlat/ptrace_cmds.in: Add PTRACE_PEEKSIGINFO, PTRACE_GETSIGMASK,
and PTRACE_SETSIGMASK.

9 years agoUpdate SWAP_FLAG_* constants
Dmitry V. Levin [Sat, 13 Dec 2014 01:34:47 +0000 (01:34 +0000)]
Update SWAP_FLAG_* constants

* swapon.c: Ensure that SWAP_FLAG_DISCARD_ONCE and
SWAP_FLAG_DISCARD_PAGES are defined.
* xlat/swap_flags.in: Add SWAP_FLAG_DISCARD_ONCE and
SWAP_FLAG_DISCARD_PAGES.

9 years agoUpdate SCHED_* constants
Dmitry V. Levin [Thu, 11 Dec 2014 21:32:52 +0000 (21:32 +0000)]
Update SCHED_* constants

* xlat/schedulers.in: Add SCHED_BATCH, SCHED_ISO, SCHED_IDLE, and
SCHED_DEADLINE.

9 years agoUpdate prctl PR_* constants
Dmitry V. Levin [Thu, 11 Dec 2014 20:54:34 +0000 (20:54 +0000)]
Update prctl PR_* constants

* xlat/prctl_options.in: Add PR_SET_THP_DISABLE, PR_GET_THP_DISABLE,
PR_MPX_ENABLE_MANAGEMENT, and PR_MPX_DISABLE_MANAGEMENT.

9 years agoAlways compile sys_prctl parser
Dmitry V. Levin [Thu, 11 Dec 2014 20:44:10 +0000 (20:44 +0000)]
Always compile sys_prctl parser

Since sys_prctl is referenced by syscallent files unconditionally,
conditional compilation of sys_prctl depending on prctl availability is
pointless.

* prctl.c (unalignctl_string, sys_prctl): Compile unconditionally.

9 years agoprocess.c: split struct_user_offsets into architecture-specific include files
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
process.c: split struct_user_offsets into architecture-specific include files

* Makefile.am (EXTRA_DIST): Add linux/alpha/userent.h,
linux/arm/userent.h, linux/avr32/userent.h, linux/bfin/userent.h,
linux/crisv10/userent.h, linux/crisv32/userent.h,
linux/i386/userent.h, linux/i386/userent0.h, linux/ia64/userent.h,
linux/m68k/userent.h, linux/microblaze/userent.h,
linux/mips/userent.h, linux/or1k/userent.h, linux/powerpc/userent.h,
linux/s390/userent.h, linux/s390/userent0.h, linux/s390/userent1.h,
linux/s390x/userent.h, linux/sh/userent.h, linux/sh/userent0.h,
linux/sh64/userent.h, linux/sparc/userent.h, linux/sparc64/userent.h,
linux/tile/userent.h, linux/userent.h, linux/userent0.h,
linux/x32/userent.h, linux/x86_64/userent.h, and
linux/xtensa/userent.h.
* process.c (struct_user_offsets): Split into architecture-specific
include files, inculde userent.h.

9 years agoprocess.c: include less headers
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
process.c: include less headers

* process.c: Do not include <fcntl.h> and <sys/stat.h>.
Reorder inclusion of xlat header files.

9 years agoUnexport struct_user_offsets
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
Unexport struct_user_offsets

* defs.h (struct_user_offsets): Remove.
* process.c (struct_user_offsets): Make static.

9 years agoprocess.c: introduce XLAT_UOFF macro
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
process.c: introduce XLAT_UOFF macro

Introduce XLAT_UOFF macro and use it to automatically transform
struct_user_offsets array into a more readable and compact form.

for n in $(sed -n 's/^[[:space:]]*{[[:space:]]*uoff(\([a-z_0-9]\+\)),.*/\1/p' process.c |sort -u); do
sed -i 's/^\([[:space:]]*\){[[:space:]]*uoff('"$n"'),[[:space:]]*"offsetof(struct user,[[:space:]]*'"$n"')"[[:space:]]*},$/\1XLAT_UOFF('"$n"'),/' process.c
done

* process.c (XLAT_UOFF): New macro.
(struct_user_offsets): Use it.

9 years agoprocess.c: move sethostname and gethostname parsers to a separate file
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
process.c: move sethostname and gethostname parsers to a separate file

* hostname.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c (sys_sethostname, sys_gethostname): Move to hostname.c.

9 years agoprocess.c: move exit parser to a separate file
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
process.c: move exit parser to a separate file

* exit.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c (sys_exit): Move to exit.c.

9 years agoprocess.c: move clone, setns, unshare, and fork parsers to a separate file
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
process.c: move clone, setns, unshare, and fork parsers to a separate file

* clone.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c: Move sys_clone, sys_setns, sys_unshare, sys_fork, and
related code to clone.c.

9 years agoprocess.c: move get*uid and set*uid parsers to a separate file
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
process.c: move get*uid and set*uid parsers to a separate file

* uid.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c (sys_getuid, sys_setfsuid, sys_setuid, sys_getresuid,
sys_setreuid, sys_setresuid): Move to uid.c.

9 years agoprocess.c: move getgroups* and setgroups* parsers to a separate file
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
process.c: move getgroups* and setgroups* parsers to a separate file

* groups.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c: Move sys_setgroups, sys_getgroups, sys_setgroups32,
sys_getgroups32, and related code to groups.c.

9 years agoprocess.c: move execve and execv parsers to a separate file
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
process.c: move execve and execv parsers to a separate file

* execve.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c: Move sys_execve, sys_execv, and related code to execve.c.

9 years agoprocess.c: move waitpid, wait4, osf_wait4, and waitid parsers to a separate file
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
process.c: move waitpid, wait4, osf_wait4, and waitid parsers to a separate file

* wait.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c: Move sys_waitpid, sys_wait4, sys_osf_wait4, sys_waitid and
related code to wait.c.

9 years agoprocess.c: move uname parser to a separate file
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
process.c: move uname parser to a separate file

* uname.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c (sys_uname): Move to uname.c.

9 years agoprocess.c: move futex parser to a separate file
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
process.c: move futex parser to a separate file

* futex.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c: Move sys_futex and related code to futex.c.

9 years agoprocess.c: move get_robust_list parser to a separate file
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
process.c: move get_robust_list parser to a separate file

* get_robust_list.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c (sys_get_robust_list): Move to get_robust_list.c.

9 years agoprocess.c: move sched_* parsers to a separate file
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
process.c: move sched_* parsers to a separate file

* sched.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c: Move sys_sched_getscheduler, sys_sched_setscheduler,
sys_sched_getparam, sys_sched_setparam, sys_sched_get_priority_min,
sys_sched_rr_get_interval, and related code to sched.c.

9 years agoprocess.c: move sched_setaffinity and sched_getaffinity parsers to a separate file
Dmitry V. Levin [Thu, 11 Dec 2014 19:25:02 +0000 (19:25 +0000)]
process.c: move sched_setaffinity and sched_getaffinity parsers to a separate file

* affinity.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* process.c (sys_sched_setaffinity, sys_sched_getaffinity): Move
to affinity.c.