Date: Sat, 3 Oct 2015 15:29:36 -0700 From: Mark Johnston <markj@freebsd.org> To: Jilles Tjoelker <jilles@stack.nl> Cc: src-committers <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org> Subject: Re: svn commit: r288628 - head/sys/kern Message-ID: <CAMw1wOyqjZomcp2oAPA%2BsAnBoK7ki6ybJ1FrAm-9p1EadjcTmw@mail.gmail.com> In-Reply-To: <20151003213311.GB57303@stack.nl> References: <201510031937.t93Jbgkk077518@repo.freebsd.org> <20151003213311.GB57303@stack.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Oct 3, 2015 at 2:33 PM, Jilles Tjoelker <jilles@stack.nl> wrote: > On Sat, Oct 03, 2015 at 07:37:42PM +0000, Mark Johnston wrote: >> Author: markj >> Date: Sat Oct 3 19:37:41 2015 >> New Revision: 288628 >> URL: https://svnweb.freebsd.org/changeset/base/288628 > >> Log: >> The return value of posix_fadvise(2) is just an error status, so >> sys_posix_fadvise() should simply return the errno (or 0) to syscallenter() >> rather than setting a return value. > >> MFC after: 1 week > >> Modified: >> head/sys/kern/vfs_syscalls.c >> >> Modified: head/sys/kern/vfs_syscalls.c >> ============================================================================== >> --- head/sys/kern/vfs_syscalls.c Sat Oct 3 19:27:52 2015 (r288627) >> +++ head/sys/kern/vfs_syscalls.c Sat Oct 3 19:37:41 2015 (r288628) >> @@ -4663,7 +4663,6 @@ int >> sys_posix_fadvise(struct thread *td, struct posix_fadvise_args *uap) >> { >> >> - td->td_retval[0] = kern_posix_fadvise(td, uap->fd, uap->offset, >> - uap->len, uap->advice); >> - return (0); >> + return (kern_posix_fadvise(td, uap->fd, uap->offset, uap->len, >> + uap->advice)); >> } > > This change makes the code match the man page, but in fact, the code was > right and the man page is wrong. Per POSIX, posix_fadvise() shall return > 0 on success and an error number on failure, and need not modify errno. Oops, thank you. This is fixed in r288640; I updated the posix_fadvise man page to use the same wording as for posix_fallocate. > > Also, this kind of ABI change in general is almost always a bad idea > when the function is already part of a stable branch. Noted, thanks.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMw1wOyqjZomcp2oAPA%2BsAnBoK7ki6ybJ1FrAm-9p1EadjcTmw>