From owner-svn-src-head@FreeBSD.ORG Thu Jan 23 17:24:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 956E2D37; Thu, 23 Jan 2014 17:24:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 672E615AA; Thu, 23 Jan 2014 17:24:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0NHORPw039587; Thu, 23 Jan 2014 17:24:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0NHOQLE039584; Thu, 23 Jan 2014 17:24:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201401231724.s0NHOQLE039584@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 23 Jan 2014 17:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261080 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 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: Thu, 23 Jan 2014 17:24:27 -0000 Author: kib Date: Thu Jan 23 17:24:26 2014 New Revision: 261080 URL: http://svnweb.freebsd.org/changeset/base/261080 Log: The posix_fallocate(2) syscall should return error number on error, without modifying errno. Reported and tested by: Gennady Proskurin Reviewed by: mdf PR: standards/186028 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/sys/posix_fallocate.2 head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/vfs_syscalls.c Modified: head/lib/libc/sys/posix_fallocate.2 ============================================================================== --- head/lib/libc/sys/posix_fallocate.2 Thu Jan 23 14:13:12 2014 (r261079) +++ head/lib/libc/sys/posix_fallocate.2 Thu Jan 23 17:24:26 2014 (r261080) @@ -83,9 +83,9 @@ that reduces the file size to a size sma If successful, .Fn posix_fallocate returns zero. -It returns -1 on failure, and sets +It returns error number on failure, without setting .Va errno -to indicate the error. +variable. .Sh ERRORS Possible failure conditions: .Bl -tag -width Er Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Jan 23 14:13:12 2014 (r261079) +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Jan 23 17:24:26 2014 (r261080) @@ -2995,8 +2995,9 @@ freebsd32_posix_fallocate(struct thread struct freebsd32_posix_fallocate_args *uap) { - return (kern_posix_fallocate(td, uap->fd, - PAIR32TO64(off_t, uap->offset), PAIR32TO64(off_t, uap->len))); + td->td_retval[0] = kern_posix_fallocate(td, uap->fd, + PAIR32TO64(off_t, uap->offset), PAIR32TO64(off_t, uap->len)); + return (0); } int Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Jan 23 14:13:12 2014 (r261079) +++ head/sys/kern/vfs_syscalls.c Thu Jan 23 17:24:26 2014 (r261080) @@ -4584,7 +4584,9 @@ int sys_posix_fallocate(struct thread *td, struct posix_fallocate_args *uap) { - return (kern_posix_fallocate(td, uap->fd, uap->offset, uap->len)); + td->td_retval[0] = kern_posix_fallocate(td, uap->fd, uap->offset, + uap->len); + return (0); } /*