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.
diff --git a/linux/dummy.h b/linux/dummy.h
index fb60765..30ee94c 100644
--- a/linux/dummy.h
+++ b/linux/dummy.h
@@ -63,10 +63,14 @@
#define sys_fdatasync sys_close
#define sys_fsync sys_close
#define sys_getegid sys_getuid
+#define sys_getegid16 sys_geteuid16
#define sys_geteuid sys_getuid
+#define sys_geteuid16 sys_getuid16
#define sys_getgid sys_getuid
+#define sys_getgid16 sys_getuid16
#define sys_getpeername sys_getsockname
#define sys_getresgid sys_getresuid
+#define sys_getresgid16 sys_getresuid16
#define sys_lstat sys_stat
#define sys_lstat64 sys_stat64
#define sys_mkdir sys_chmod
@@ -82,9 +86,13 @@
#define sys_set_robust_list sys_munmap
#define sys_setdomainname sys_sethostname
#define sys_setfsgid sys_setfsuid
+#define sys_setfsgid16 sys_setfsuid16
#define sys_setgid sys_setuid
+#define sys_setgid16 sys_setuid16
#define sys_setregid sys_setreuid
+#define sys_setregid16 sys_setreuid16
#define sys_setresgid sys_setresuid
+#define sys_setresgid16 sys_setresuid16
#define sys_stime sys_time
#define sys_swapoff sys_chdir
#define sys_symlink sys_link