From owner-svn-src-head@freebsd.org Sat Oct 3 21:33:14 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5AA9A0E63B; Sat, 3 Oct 2015 21:33:14 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E8461781; Sat, 3 Oct 2015 21:33:14 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 3B516359302; Sat, 3 Oct 2015 23:33:12 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 0EE7028494; Sat, 3 Oct 2015 23:33:12 +0200 (CEST) Date: Sat, 3 Oct 2015 23:33:12 +0200 From: Jilles Tjoelker To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r288628 - head/sys/kern Message-ID: <20151003213311.GB57303@stack.nl> References: <201510031937.t93Jbgkk077518@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201510031937.t93Jbgkk077518@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2015 21:33:14 -0000 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. Also, this kind of ABI change in general is almost always a bad idea when the function is already part of a stable branch. -- Jilles Tjoelker