Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Dec 2015 09:32:36 -0800
From:      Mark Johnston <markj@FreeBSD.org>
To:        Maxim Sobolev <sobomax@FreeBSD.org>
Cc:        freebsd-current@freebsd.org, freebsd-hackers@freebsd.org, Kirk McKusick <mckusick@mckusick.com>, kib@freebsd.org
Subject:   Re: posix_fallocate(2) && posix_fadvise(2) are somewhat broken
Message-ID:  <20151208173236.GA11078@raichu>
In-Reply-To: <CAH7qZfvV-RepAc6N0UxFi2RBthxrd%2BqHD-Qh5dc-9v=NFGCy_w@mail.gmail.com>
References:  <CAH7qZfvV-RepAc6N0UxFi2RBthxrd%2BqHD-Qh5dc-9v=NFGCy_w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20151208173236.GA11078>