Test: Replace test relying on pselect6(2) man page ambiguity
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 31 May 2017 21:08:23 +0000 (17:08 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 1 Jun 2017 18:13:40 +0000 (14:13 -0400)
commit85716797531014241b9bc2b2ffa01215fd9ba6d1
tree1ab9a88d133093185b048ced11d0fff777362254
parent612b8ed86aab0cd7549a433c50ecc9e999227077
Test: Replace test relying on pselect6(2) man page ambiguity

The `pselect_fd_too_big` test is checking for the case where the `nfds`
is larger than the number of open files allowed for this process
(RLIMIT_NOFILE).

According to the ERRORS section of the pselect6(2) kernel man page[1], if
`nfds` > RLIMIT_NOFILE is evaluate to true the pselect6 syscall should
return EINVAL but the BUGS section mentions that the current
implementation ignores any FD larger than the highest numbered FD of the
current process.

This is in fact what happens. The Linux implementation of the pselect6
syscall[2] does not compare the `nfds` and RLIMIT_NOFILE, but rather caps
`nfds` to the highest numbered FD of the current process as the BUGS
kernel man page mentionned.

It was observed elsewhere that there is a discrepancy between the manual
page and the implementation[3].

As a solution, replace the current testcase with one that checks the
behaviour of the syscall when an invalid FD is passed.

[1]:http://man7.org/linux/man-pages/man2/pselect6.2.html
[2]:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/select.c#n619
[3]:https://patchwork.kernel.org/patch/9345805/

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/kernel/select_poll_epoll.c
tests/regression/kernel/test_select_poll_epoll
tests/regression/kernel/validate_select_poll_epoll.py
This page took 0.025214 seconds and 4 git commands to generate.