From f55ef46feb20967b065fa683eed70aae5346f87f Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Fri, 16 Dec 2016 12:01:44 +0000 Subject: [PATCH] Include "kernel_types.h" in defs.h and tests/tests.h As kernel_ulong_t type is going to be used in the definition of struct tcb and in many function prototypes, make it readily available for every source file by including "kernel_types.h" in defs.h and tests/tests.h files. * defs.h: Include "kernel_types.h". * tests/tests.h: Likewise. * desc.c: Do not include "kernel_types.h". * dirent.c: Likewise. * keyctl.c: Likewise. * syscall.c: Likewise. * linux/asm_stat.h: Likewise. * tests/answer.c: Likewise. * tests/epoll_pwait.c: Likewise. * tests/fanotify_init.c: Likewise. * tests/fanotify_mark.c: Likewise. * tests/file_handle.c: Likewise. * tests/ftruncate.c: Likewise. * tests/getdents.c: Likewise. * tests/init_delete_module.h: Likewise. * tests/inotify.c: Likewise. * tests/inotify_init1.c: Likewise. * tests/ioprio.c: Likewise. * tests/ipc_msgbuf.c: Likewise. * tests/kcmp.c: Likewise. * tests/kexec_file_load.c: Likewise. * tests/kexec_load.c: Likewise. * tests/keyctl.c: Likewise. * tests/lookup_dcookie.c: Likewise. * tests/lseek.c: Likewise. * tests/mq_sendrecv.c: Likewise. * tests/nsyscalls.c: Likewise. * tests/pkey_alloc.c: Likewise. * tests/pkey_free.c: Likewise. * tests/pkey_mprotect.c: Likewise. * tests/prctl-pdeathsig.c: Likewise. * tests/prctl-tsc.c: Likewise. * tests/preadv2-pwritev2.c: Likewise. * tests/process_vm_readv_writev.c: Likewise. * tests/read-write.c: Likewise. * tests/setfsugid.c: Likewise. * tests/setns.c: Likewise. * tests/truncate.c: Likewise. * tests/unshare.c: Likewise. * tests/xgetrlimit.c: Likewise. --- defs.h | 1 + desc.c | 2 -- dirent.c | 2 -- keyctl.c | 1 - linux/asm_stat.h | 2 -- syscall.c | 2 -- tests/answer.c | 1 - tests/epoll_pwait.c | 2 -- tests/fanotify_init.c | 2 -- tests/fanotify_mark.c | 3 --- tests/file_handle.c | 2 -- tests/ftruncate.c | 2 -- tests/getdents.c | 1 - tests/init_delete_module.h | 3 --- tests/inotify.c | 2 -- tests/inotify_init1.c | 2 -- tests/ioprio.c | 2 -- tests/ipc_msgbuf.c | 1 - tests/kcmp.c | 2 -- tests/kexec_file_load.c | 2 -- tests/kexec_load.c | 2 -- tests/keyctl.c | 3 --- tests/lookup_dcookie.c | 3 --- tests/lseek.c | 1 - tests/mq_sendrecv.c | 1 - tests/nsyscalls.c | 1 - tests/pkey_alloc.c | 2 -- tests/pkey_free.c | 2 -- tests/pkey_mprotect.c | 2 -- tests/prctl-pdeathsig.c | 2 -- tests/prctl-tsc.c | 2 -- tests/preadv2-pwritev2.c | 1 - tests/process_vm_readv_writev.c | 3 --- tests/read-write.c | 1 - tests/setfsugid.c | 2 -- tests/setns.c | 2 -- tests/tests.h | 1 + tests/truncate.c | 1 - tests/unshare.c | 2 -- tests/xgetrlimit.c | 1 - 40 files changed, 2 insertions(+), 70 deletions(-) diff --git a/defs.h b/defs.h index cdeb22fd..0af7c888 100644 --- a/defs.h +++ b/defs.h @@ -53,6 +53,7 @@ #include #include +#include "kernel_types.h" #include "mpers_type.h" #include "gcc_compat.h" diff --git a/desc.c b/desc.c index 4695db58..5badb144 100644 --- a/desc.c +++ b/desc.c @@ -226,8 +226,6 @@ SYS_FUNC(select) return decode_select(tcp, tcp->u_arg, print_timeval, sprint_timeval); } -#include "kernel_types.h" - static int umove_kulong_array_or_printaddr(struct tcb *tcp, const long addr, kernel_ulong_t *ptr, size_t n) diff --git a/dirent.c b/dirent.c index c2776752..936453e0 100644 --- a/dirent.c +++ b/dirent.c @@ -33,8 +33,6 @@ #include DEF_MPERS_TYPE(kernel_dirent) -#include "kernel_types.h" - #include MPERS_DEFS #define D_NAME_LEN_MAX 256 diff --git a/keyctl.c b/keyctl.c index 7f047c6b..94c29765 100644 --- a/keyctl.c +++ b/keyctl.c @@ -26,7 +26,6 @@ */ #include "defs.h" -#include "kernel_types.h" typedef int32_t key_serial_t; diff --git a/linux/asm_stat.h b/linux/asm_stat.h index 72a67e1d..a9266020 100644 --- a/linux/asm_stat.h +++ b/linux/asm_stat.h @@ -1,8 +1,6 @@ #ifndef STRACE_ASM_STAT_H #define STRACE_ASM_STAT_H -# include "kernel_types.h" - # undef dev_t # undef gid_t # undef ino_t diff --git a/syscall.c b/syscall.c index 685ea929..03dc350a 100644 --- a/syscall.c +++ b/syscall.c @@ -1003,8 +1003,6 @@ restore_cleared_syserror(struct tcb *tcp) tcp->u_error = saved_u_error; } -#include "kernel_types.h" - /* * Check the syscall return value register value for whether it is * a negated errno code indicating an error, or a success return value. diff --git a/tests/answer.c b/tests/answer.c index 8d5387e8..ae3059a4 100644 --- a/tests/answer.c +++ b/tests/answer.c @@ -30,7 +30,6 @@ #include "tests.h" #include #include -#include "kernel_types.h" int main(void) diff --git a/tests/epoll_pwait.c b/tests/epoll_pwait.c index 27337ece..eaaa34d6 100644 --- a/tests/epoll_pwait.c +++ b/tests/epoll_pwait.c @@ -8,8 +8,6 @@ # include # include -# include "kernel_types.h" - int main(void) { diff --git a/tests/fanotify_init.c b/tests/fanotify_init.c index f784e195..c14b4131 100644 --- a/tests/fanotify_init.c +++ b/tests/fanotify_init.c @@ -37,8 +37,6 @@ # include # include -# include "kernel_types.h" - /* Performs fanotify_init call via the syscall interface. */ static void do_call(kernel_ulong_t flags, const char *flags_str, diff --git a/tests/fanotify_mark.c b/tests/fanotify_mark.c index c475756e..43f285d3 100644 --- a/tests/fanotify_mark.c +++ b/tests/fanotify_mark.c @@ -38,11 +38,8 @@ # include # include # include - # include -# include "kernel_types.h" - /* Performs fanotify_mark call via the syscall interface. */ static void do_call(kernel_ulong_t fd, kernel_ulong_t flags, const char *flags_str, diff --git a/tests/file_handle.c b/tests/file_handle.c index 22797751..a5ad6c73 100644 --- a/tests/file_handle.c +++ b/tests/file_handle.c @@ -41,8 +41,6 @@ # include # include -# include "kernel_types.h" - enum assert_rc { ASSERT_NONE, ASSERT_SUCCESS, diff --git a/tests/ftruncate.c b/tests/ftruncate.c index 315f7bf1..ee17455f 100644 --- a/tests/ftruncate.c +++ b/tests/ftruncate.c @@ -33,8 +33,6 @@ # include # include -# include "kernel_types.h" - int main(void) { diff --git a/tests/getdents.c b/tests/getdents.c index 4c8455f8..b787c837 100644 --- a/tests/getdents.c +++ b/tests/getdents.c @@ -37,7 +37,6 @@ # include # include # include -# include "kernel_types.h" static const char fname[] = "A\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\nA\n" diff --git a/tests/init_delete_module.h b/tests/init_delete_module.h index f16994c7..db550c33 100644 --- a/tests/init_delete_module.h +++ b/tests/init_delete_module.h @@ -34,9 +34,6 @@ # include # include -# include "kernel_types.h" - - enum { PARAM1_LEN = 33, PARAM2_LEN = 8, diff --git a/tests/inotify.c b/tests/inotify.c index fb665526..925d69ff 100644 --- a/tests/inotify.c +++ b/tests/inotify.c @@ -37,8 +37,6 @@ # include # include -# include "kernel_types.h" - int main(void) { diff --git a/tests/inotify_init1.c b/tests/inotify_init1.c index 4c08259b..0325150d 100644 --- a/tests/inotify_init1.c +++ b/tests/inotify_init1.c @@ -37,8 +37,6 @@ # include # include -# include "kernel_types.h" - # ifdef O_CLOEXEC # define cloexec_flag O_CLOEXEC # else diff --git a/tests/ioprio.c b/tests/ioprio.c index 6f360adb..44ace6c3 100644 --- a/tests/ioprio.c +++ b/tests/ioprio.c @@ -36,8 +36,6 @@ # include # include -# include "kernel_types.h" - enum { IOPRIO_CLASS_NONE, IOPRIO_CLASS_RT, diff --git a/tests/ipc_msgbuf.c b/tests/ipc_msgbuf.c index 2c90d268..1c34494d 100644 --- a/tests/ipc_msgbuf.c +++ b/tests/ipc_msgbuf.c @@ -31,7 +31,6 @@ #include #include #include -#include "kernel_types.h" #define text_string "STRACE_STRING" #define msgsz sizeof(text_string) diff --git a/tests/kcmp.c b/tests/kcmp.c index 2e2e5ff5..0f43c634 100644 --- a/tests/kcmp.c +++ b/tests/kcmp.c @@ -36,8 +36,6 @@ # include # include -# include "kernel_types.h" - # define KCMP_FILE 0 # define KCMP_SYSVSEM 6 diff --git a/tests/kexec_file_load.c b/tests/kexec_file_load.c index 5846c6af..b44cbce2 100644 --- a/tests/kexec_file_load.c +++ b/tests/kexec_file_load.c @@ -37,8 +37,6 @@ # include # include -# include "kernel_types.h" - struct strval { kernel_ulong_t val; const char *str64; diff --git a/tests/kexec_load.c b/tests/kexec_load.c index 45834c9a..8eb0e272 100644 --- a/tests/kexec_load.c +++ b/tests/kexec_load.c @@ -36,8 +36,6 @@ # include # include -# include "kernel_types.h" - struct strval { kernel_ulong_t val; const char *str64; diff --git a/tests/keyctl.c b/tests/keyctl.c index f071e707..2e26076b 100644 --- a/tests/keyctl.c +++ b/tests/keyctl.c @@ -44,11 +44,8 @@ # include # include # include - # include -# include "kernel_types.h" - /* This check should be before #include "xlat/keyctl_commands.h" */ # ifndef KEYCTL_DH_COMPUTE struct keyctl_dh_params { diff --git a/tests/lookup_dcookie.c b/tests/lookup_dcookie.c index 335efb23..986180ce 100644 --- a/tests/lookup_dcookie.c +++ b/tests/lookup_dcookie.c @@ -38,9 +38,6 @@ # include # include -# include "kernel_types.h" - - static void do_lookup_cookie(uint64_t cookie, char *buf, kernel_ulong_t len) { diff --git a/tests/lseek.c b/tests/lseek.c index 84b27529..4428c4e9 100644 --- a/tests/lseek.c +++ b/tests/lseek.c @@ -32,7 +32,6 @@ # include # include -# include "kernel_types.h" int main(void) diff --git a/tests/mq_sendrecv.c b/tests/mq_sendrecv.c index 995bbb0d..a5bed01b 100644 --- a/tests/mq_sendrecv.c +++ b/tests/mq_sendrecv.c @@ -47,7 +47,6 @@ # include # include -# include "kernel_types.h" # include "sigevent.h" # ifndef MQ_NAME diff --git a/tests/nsyscalls.c b/tests/nsyscalls.c index 68cb1481..9c8b30a7 100644 --- a/tests/nsyscalls.c +++ b/tests/nsyscalls.c @@ -28,7 +28,6 @@ */ #include "defs.h" -#include "kernel_types.h" #include "syscall.h" #define TD 0 diff --git a/tests/pkey_alloc.c b/tests/pkey_alloc.c index 906d67f8..19840f24 100644 --- a/tests/pkey_alloc.c +++ b/tests/pkey_alloc.c @@ -36,8 +36,6 @@ # include # include -# include "kernel_types.h" - int main(void) { diff --git a/tests/pkey_free.c b/tests/pkey_free.c index 13f9e58f..1815ad9f 100644 --- a/tests/pkey_free.c +++ b/tests/pkey_free.c @@ -36,8 +36,6 @@ # include # include -# include "kernel_types.h" - int main(void) { diff --git a/tests/pkey_mprotect.c b/tests/pkey_mprotect.c index e62ae795..6ba77884 100644 --- a/tests/pkey_mprotect.c +++ b/tests/pkey_mprotect.c @@ -38,8 +38,6 @@ #include -# include "kernel_types.h" - const char * sprintptr(kernel_ulong_t ptr) { diff --git a/tests/prctl-pdeathsig.c b/tests/prctl-pdeathsig.c index a2143c28..c1760307 100644 --- a/tests/prctl-pdeathsig.c +++ b/tests/prctl-pdeathsig.c @@ -38,8 +38,6 @@ # include # include -# include "kernel_types.h" - int main(void) { diff --git a/tests/prctl-tsc.c b/tests/prctl-tsc.c index 86668d95..fd9362d7 100644 --- a/tests/prctl-tsc.c +++ b/tests/prctl-tsc.c @@ -37,8 +37,6 @@ # include # include -# include "kernel_types.h" - int main(void) { diff --git a/tests/preadv2-pwritev2.c b/tests/preadv2-pwritev2.c index fb725071..9f1dd95d 100644 --- a/tests/preadv2-pwritev2.c +++ b/tests/preadv2-pwritev2.c @@ -37,7 +37,6 @@ # include # include # include -# include "kernel_types.h" static int pr(const int fd, const struct iovec *const vec, diff --git a/tests/process_vm_readv_writev.c b/tests/process_vm_readv_writev.c index 7e9b52a9..2a089395 100644 --- a/tests/process_vm_readv_writev.c +++ b/tests/process_vm_readv_writev.c @@ -30,11 +30,8 @@ #include #include #include - #include -#include "kernel_types.h" - #if OP_WR # define in_iovec rmt_iovec # define out_iovec lcl_iovec diff --git a/tests/read-write.c b/tests/read-write.c index 0e3ff66a..262e07b5 100644 --- a/tests/read-write.c +++ b/tests/read-write.c @@ -34,7 +34,6 @@ #include #include #include -#include "kernel_types.h" static void dump_str(const char *str, const unsigned int len) diff --git a/tests/setfsugid.c b/tests/setfsugid.c index a410c9d9..79ba34d8 100644 --- a/tests/setfsugid.c +++ b/tests/setfsugid.c @@ -30,8 +30,6 @@ #include #include -#include "kernel_types.h" - void printuid(unsigned UGID_TYPE id) { diff --git a/tests/setns.c b/tests/setns.c index 5c08802b..54a15317 100644 --- a/tests/setns.c +++ b/tests/setns.c @@ -36,8 +36,6 @@ # include # include -# include "kernel_types.h" - int main(void) { diff --git a/tests/tests.h b/tests/tests.h index f2e0a82b..1724124b 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -33,6 +33,7 @@ # endif # include +# include "kernel_types.h" # include "gcc_compat.h" /* Tests of "strace -v" are expected to define VERBOSE to 1. */ diff --git a/tests/truncate.c b/tests/truncate.c index 3f16aefd..d9529334 100644 --- a/tests/truncate.c +++ b/tests/truncate.c @@ -32,7 +32,6 @@ # include # include -# include "kernel_types.h" int main(void) diff --git a/tests/unshare.c b/tests/unshare.c index 7b702dcb..5aedde47 100644 --- a/tests/unshare.c +++ b/tests/unshare.c @@ -36,8 +36,6 @@ # include # include -# include "kernel_types.h" - int main(void) { diff --git a/tests/xgetrlimit.c b/tests/xgetrlimit.c index 54ced9a7..78d9cb99 100644 --- a/tests/xgetrlimit.c +++ b/tests/xgetrlimit.c @@ -33,7 +33,6 @@ #include #include -#include "kernel_types.h" #include "xlat.h" #include "xlat/resources.h" -- 2.50.1