From: Francis Deslauriers Date: Wed, 31 May 2017 21:08:23 +0000 (-0400) Subject: Test: Replace test relying on pselect6(2) man page ambiguity X-Git-Tag: v2.11.0-rc1~547 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;ds=sidebyside;h=8b3b99e2870d53c97f9ec9a976ed91f43da5f02b;hp=8b3b99e2870d53c97f9ec9a976ed91f43da5f02b;p=lttng-tools.git 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 Signed-off-by: Julien Desfossez Signed-off-by: Jérémie Galarneau ---