Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tests: move common definitions and functions into pidfd.h

Move definitions and functions used across different pidfd tests into
pidfd.h header.

Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Christian Brauner <christian@brauner.io>
Link: https://lore.kernel.org/r/20190726162226.252750-1-surenb@google.com
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>

authored by

Suren Baghdasaryan and committed by
Christian Brauner
2ec2f99a e63f3085

+5 -5
+5
tools/testing/selftests/pidfd/pidfd.h
··· 73 73 return WEXITSTATUS(status); 74 74 } 75 75 76 + static inline int sys_pidfd_open(pid_t pid, unsigned int flags) 77 + { 78 + return syscall(__NR_pidfd_open, pid, flags); 79 + } 80 + 76 81 static inline int sys_pidfd_send_signal(int pidfd, int sig, siginfo_t *info, 77 82 unsigned int flags) 78 83 {
-5
tools/testing/selftests/pidfd/pidfd_open_test.c
··· 22 22 #include "pidfd.h" 23 23 #include "../kselftest.h" 24 24 25 - static inline int sys_pidfd_open(pid_t pid, unsigned int flags) 26 - { 27 - return syscall(__NR_pidfd_open, pid, flags); 28 - } 29 - 30 25 static int safe_int(const char *numstr, int *converted) 31 26 { 32 27 char *err = NULL;