summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/pidfd
diff options
context:
space:
mode:
authorSuren Baghdasaryan <surenb@google.com>2019-07-26 09:22:25 -0700
committerChristian Brauner <christian.brauner@ubuntu.com>2019-08-06 19:39:45 +0200
commit2ec2f99abd2c75b507410c5def731fe1b483271b (patch)
tree5936523fc6f30d651c9f33d7798e894f2fb8862a /tools/testing/selftests/pidfd
parente63f3085709e92bd876e2977a07099d56bbda1c2 (diff)
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>
Diffstat (limited to 'tools/testing/selftests/pidfd')
-rw-r--r--tools/testing/selftests/pidfd/pidfd.h5
-rw-r--r--tools/testing/selftests/pidfd/pidfd_open_test.c5
2 files changed, 5 insertions, 5 deletions
diff --git a/tools/testing/selftests/pidfd/pidfd.h b/tools/testing/selftests/pidfd/pidfd.h
index 7d7d0ca05e0b..c6bc68329f4b 100644
--- a/tools/testing/selftests/pidfd/pidfd.h
+++ b/tools/testing/selftests/pidfd/pidfd.h
@@ -73,6 +73,11 @@ again:
return WEXITSTATUS(status);
}
+static inline int sys_pidfd_open(pid_t pid, unsigned int flags)
+{
+ return syscall(__NR_pidfd_open, pid, flags);
+}
+
static inline int sys_pidfd_send_signal(int pidfd, int sig, siginfo_t *info,
unsigned int flags)
{
diff --git a/tools/testing/selftests/pidfd/pidfd_open_test.c b/tools/testing/selftests/pidfd/pidfd_open_test.c
index 0377133dd6dc..b9fe75fc3e51 100644
--- a/tools/testing/selftests/pidfd/pidfd_open_test.c
+++ b/tools/testing/selftests/pidfd/pidfd_open_test.c
@@ -22,11 +22,6 @@
#include "pidfd.h"
#include "../kselftest.h"
-static inline int sys_pidfd_open(pid_t pid, unsigned int flags)
-{
- return syscall(__NR_pidfd_open, pid, flags);
-}
-
static int safe_int(const char *numstr, int *converted)
{
char *err = NULL;