This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix misreported errno on preadv2/pwritev2 (BZ#23579)


* Adhemerval Zanella:

> On 28/09/2018 11:10, Florian Weimer wrote:
>> * Adhemerval Zanella:
>> 
>>> 	[BZ #23579]
>>> 	* misc/tst-preadvwritev2-common.c (do_test_with_invalid_fd): New
>>> 	test.
>>> 	* misc/tst-preadvwritev2.c, misc/tst-preadvwritev64v2.c (do_test):
>>> 	Call do_test_with_invalid_fd.
>>> 	* sysdeps/unix/sysv/linux/preadv2.c (preadv2): Use fallback code iff
>>> 	errno is ENOSYS.
>>> 	* sysdeps/unix/sysv/linux/preadv64v2.c (preadv64v2): Likewise.
>>> 	* sysdeps/unix/sysv/linux/pwritev2.c (pwritev2): Likewise.
>>> 	* sysdeps/unix/sysv/linux/pwritev64v2.c (pwritev64v2): Likewise.
>> 
>> Looks okay to me.
>> 
>> I see that we return ENOTSUP for invalid flags, but the kernel returns
>> EINVAL.  But this is a preexisting problem, unrelated to this patch.
>
> Yeah, I described this discrepancy in commit message and I can't really see
> how to easy emulate it.

I think there are two issues: EBADF vs flag error, and that the flag
error is ENOTSUP, not EINVAL as the kernel returns (according to the
manual page at least).  The second part would be fixable, but not the
first part.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]