diff options
author | Christian Brauner <christian.brauner@ubuntu.com> | 2020-09-02 13:21:30 +0300 |
---|---|---|
committer | Christian Brauner <christian.brauner@ubuntu.com> | 2020-09-04 14:48:57 +0300 |
commit | cd89597bbe5a0179b3f0f51604cb36a1ffd4e080 (patch) | |
tree | f9b20216145fa8b214c9198510d558f97709bf07 /tools/testing/selftests/pidfd/pidfd.h | |
parent | 09d1de1a8e7b9fbf08e96e0aecf41f870e4433ee (diff) | |
download | linux-cd89597bbe5a0179b3f0f51604cb36a1ffd4e080.tar.xz |
tests: add waitid() tests for non-blocking pidfds
Verify that the PIDFD_NONBLOCK flag works with pidfd_open() and that
waitid() with a non-blocking pidfd returns EAGAIN:
TAP version 13
1..3
# Starting 3 tests from 1 test cases.
# RUN global.wait_simple ...
# OK global.wait_simple
ok 1 global.wait_simple
# RUN global.wait_states ...
# OK global.wait_states
ok 2 global.wait_states
# RUN global.wait_nonblock ...
# OK global.wait_nonblock
ok 3 global.wait_nonblock
# PASSED: 3 / 3 tests passed.
# Totals: pass:3 fail:0 xfail:0 xpass:0 skip:0 error:0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: linux-kselftest@vger.kernel.org
Link: https://lore.kernel.org/r/20200902102130.147672-5-christian.brauner@ubuntu.com
Diffstat (limited to 'tools/testing/selftests/pidfd/pidfd.h')
-rw-r--r-- | tools/testing/selftests/pidfd/pidfd.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/pidfd/pidfd.h b/tools/testing/selftests/pidfd/pidfd.h index a2c80914e3dc..01f8d3c0cf2c 100644 --- a/tools/testing/selftests/pidfd/pidfd.h +++ b/tools/testing/selftests/pidfd/pidfd.h @@ -46,6 +46,10 @@ #define __NR_pidfd_getfd -1 #endif +#ifndef PIDFD_NONBLOCK +#define PIDFD_NONBLOCK O_NONBLOCK +#endif + /* * The kernel reserves 300 pids via RESERVED_PIDS in kernel/pid.c * That means, when it wraps around any pid < 300 will be skipped. |