aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/pidfd/pidfd.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-06-24 14:19:45 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-06-24 14:19:45 -0700
commitfbb58011fdd9ca2e2f0e329d11085ddf46830c5a (patch)
treed7676fe1dccba822166a83ac9f693491ecbe6190 /tools/testing/selftests/pidfd/pidfd.h
parentMerge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm (diff)
parenttests: test for setns() EINVAL regression (diff)
downloadwireguard-linux-fbb58011fdd9ca2e2f0e329d11085ddf46830c5a.tar.xz
wireguard-linux-fbb58011fdd9ca2e2f0e329d11085ddf46830c5a.zip
Merge tag 'for-linus-2020-06-24' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux
Pull thread fix from Christian Brauner: "This fixes a regression introduced with 303cc571d107 ("nsproxy: attach to namespaces via pidfds"). The LTP testsuite reported a regression where users would now see EBADF returned instead of EINVAL when an fd was passed that referred to an open file but the file was not a namespace file. Fix this by continuing to report EINVAL and add a regression test" * tag 'for-linus-2020-06-24' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: tests: test for setns() EINVAL regression nsproxy: restore EINVAL for non-namespace file descriptor
Diffstat (limited to 'tools/testing/selftests/pidfd/pidfd.h')
-rw-r--r--tools/testing/selftests/pidfd/pidfd.h5
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 */