Re: posix_fallocate(2) && posix_fadvise(2) are somewhat broken

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 8 Dec 2015 09:32:36 -0800
On Tue, Dec 08, 2015 at 01:35:31AM -0800, Maxim Sobolev wrote:
> Hi, while working on some unrelated feature I've noticed that at least
> those two system calls are not returning proper value (-1) on error.
> Instead actual errno value is returned from the syscall verbatim,
> i.e. posix_fadvise() returns 22 on EINVAL. Attached patch fixes that
> problem, however I am not sure if I need to assign td->td_retval[0] at all,
> those two operations by design never return anything but -1 on error and 0
> on success. Can someone comment on this? Thanks!

This behaviour is documented and specified by POSIX. I'm not sure why
these syscalls are inconsistent with everything else, but the current
implementation is correct.
Received on Tue Dec 08 2015 - 16:32:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:01 UTC