diff options
author | Christian Brauner <christian.brauner@ubuntu.com> | 2020-06-17 01:48:54 +0300 |
---|---|---|
committer | Christian Brauner <christian.brauner@ubuntu.com> | 2020-06-17 01:48:54 +0300 |
commit | 86f56395feb2b106b125c47e72192e37da5dd088 (patch) | |
tree | a63cde19caa1c5ebe0d436d836bc464f4c25b238 /tools/testing/selftests/pidfd/pidfd.h | |
parent | e571d4ee334719727f22cce30c4c74471d4ef68a (diff) | |
download | linux-86f56395feb2b106b125c47e72192e37da5dd088.tar.xz |
tests: test for setns() EINVAL regression
Verify that setns() reports EINVAL when an fd is passed that refers to an
open file but the file is not a file descriptor useable to interact with
namespaces.
Cc: Jan Stancek <jstancek@redhat.com>
Cc: Cyril Hrubis <chrubis@suse.cz>
Link: https://lore.kernel.org/lkml/20200615085836.GR12456@shao2-debian
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Diffstat (limited to 'tools/testing/selftests/pidfd/pidfd.h')
-rw-r--r-- | tools/testing/selftests/pidfd/pidfd.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/pidfd/pidfd.h b/tools/testing/selftests/pidfd/pidfd.h index c1921a53dbed..8d728eda783d 100644 --- a/tools/testing/selftests/pidfd/pidfd.h +++ b/tools/testing/selftests/pidfd/pidfd.h @@ -95,4 +95,9 @@ static inline int sys_pidfd_getfd(int pidfd, int fd, int flags) return syscall(__NR_pidfd_getfd, pidfd, fd, flags); } +static inline int sys_memfd_create(const char *name, unsigned int flags) +{ + return syscall(__NR_memfd_create, name, flags); +} + #endif /* __PIDFD_H */ |