From owner-freebsd-current@freebsd.org Tue Dec 8 17:01:47 2015 Return-Path: Delivered-To: freebsd-current@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 EA9CD9D485D for ; Tue, 8 Dec 2015 17:01:47 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (wollman-1-pt.tunnel.tserv4.nyc4.ipv6.he.net [IPv6:2001:470:1f06:ccb::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3C711138; Tue, 8 Dec 2015 17:01:47 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (localhost [127.0.0.1]) by hergotha.csail.mit.edu (8.14.9/8.14.9) with ESMTP id tB8H1jBZ009764; Tue, 8 Dec 2015 12:01:45 -0500 (EST) (envelope-from wollman@hergotha.csail.mit.edu) Received: (from wollman@localhost) by hergotha.csail.mit.edu (8.14.9/8.14.4/Submit) id tB8H1ivY009763; Tue, 8 Dec 2015 12:01:44 -0500 (EST) (envelope-from wollman) Date: Tue, 8 Dec 2015 12:01:44 -0500 (EST) From: Garrett Wollman Message-Id: <201512081701.tB8H1ivY009763@hergotha.csail.mit.edu> To: sobomax@freebsd.org Subject: Re: posix_fallocate(2) && posix_fadvise(2) are somewhat broken References: Organization: none Cc: freebsd-current@freebsd.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (hergotha.csail.mit.edu [127.0.0.1]); Tue, 08 Dec 2015 12:01:45 -0500 (EST) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hergotha.csail.mit.edu X-Mailman-Approved-At: Tue, 08 Dec 2015 17:40:10 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 17:01:48 -0000 In article 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