This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix test-errno issues
- From: Wainer dos Santos Moschetta <wainersm at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Mon, 13 Mar 2017 18:12:36 -0300
- Subject: Re: [PATCH] Fix test-errno issues
- Authentication-results: sourceware.org; auth=none
- References: <1489414901-13605-1-git-send-email-adhemerval.zanella@linaro.org>
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.