[PATCH] Fix test-errno issues

Wainer dos Santos Moschetta wainersm@linux.vnet.ibm.com
Mon Mar 13 21:13:00 GMT 2017


On 03/13/2017 11:21 AM, Adhemerval Zanella wrote:
> This patch fixes multiple issues of test-errno.c (9a56f8718341):
>
>   - Rename Linux test-errno.c to test-errno-linux.c to avoid build
>     the same source for both tests.
>
>   - Add a mlock check for 32 bits build running on 64 bits kernels.
>     Althuough man pages states that mlock fails with EINVAL if final
>     address overflows, kernels does not return it for aforementioned
>     condition (it returns ENOMEM instead).  Although it seems to be
>     a kernel issue for compat syscall handling, I think it is worth
>     to still check syscall return and document the behavior.
>
>   - Initialize option lenght for setsockopt check.
>
> Checked on x86_64-linux-gnu and i686-linux-gnu (running on 64 bits
> kernel).
>
> 	* posix/test-errno.c (do_test): Initialize setsockopt optlen.
> 	* sysdeps/unix/sysv/linux/test-errno.c: Move to ...
> 	* sysdeps/unix/sysv/linux/test-errno-linux.c: ... here.
> 	(do_test): Handle mlock return on 64 bits kernels with 32 bits
> 	binaries.
With these changes test-errno passes in ppc64le and ppc32. It fails in ppc64 (big endian) with:
FAIL: open: errno is: 20 (Not a directory) expected: 22 (Invalid argument)

Nonetheless, it is OK if you commit these changes since they fix the test for other architectures. I'll investigate the failure in ppc64 and propose a further change later if applicable.



More information about the Libc-alpha mailing list