Date: Tue, 8 Dec 2015 09:37:21 -0800 From: Maxim Sobolev <sobomax@FreeBSD.org> To: Garrett Wollman <wollman@hergotha.csail.mit.edu> Cc: freebsd-current@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: posix_fallocate(2) && posix_fadvise(2) are somewhat broken Message-ID: <CAH7qZfunb2%2B6s_n5__kgFNoWAmuXQN3LtXNkjMuocCJLMcUbRg@mail.gmail.com> In-Reply-To: <201512081701.tB8H1ivY009763@hergotha.csail.mit.edu> References: <CAH7qZfvV-RepAc6N0UxFi2RBthxrd%2BqHD-Qh5dc-9v=NFGCy_w@mail.gmail.com> <201512081701.tB8H1ivY009763@hergotha.csail.mit.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
Then it's documentation bug or maybe some discrepancy between SUS and
POSIX.
$ man posix_fadvise
RETURN VALUES
The posix_fadvise() function returns the value 0 if successful;
otherwise
the value -1 is returned and the global variable errno is set to
indicate
the error.
STANDARDS
The posix_fadvise() interface conforms to IEEE Std 1003.1-2001
(``POSIX.1'').
HISTORY
The posix_fadvise() system call first appeared in FreeBSD 9.1.
On Tue, Dec 8, 2015 at 9:01 AM, Garrett Wollman <
wollman@hergotha.csail.mit.edu> wrote:
> In article <CAH7qZfvV-RepAc6N0UxFi2RBthxrd+qHD-Qh5dc-9v=
> NFGCy_w@mail.gmail.com>
> sobomax@freebsd.org writes:
>
> >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,
>
> That is what the specification requires.
>
> RETURN VALUE
> Upon successful completion, posix_fadvise( ) shall return
> zero; otherwise, an error number shall be returned to
> indicate the error.
>
> (Quote from SUSv7 p. 1410, lines 46221-46223.)
>
> -GAWollman
>
>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAH7qZfunb2%2B6s_n5__kgFNoWAmuXQN3LtXNkjMuocCJLMcUbRg>
