From owner-freebsd-current@freebsd.org Tue Dec 8 17:37:24 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 3E4EC9D4879 for ; Tue, 8 Dec 2015 17:37:24 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9B6C159D for ; Tue, 8 Dec 2015 17:37:23 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by wmec201 with SMTP id c201so223152105wme.0 for ; Tue, 08 Dec 2015 09:37:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=aT2Mjvn64OpVhHB9XBny4RRZsVe/z+J5b+ycf24+Buk=; b=eV8nhDoWsNIWz29v3wffotBrApvqpI69V/vMM03gNPWIDcF0INYw9M+nI7vKXyL5GU Ac3+H4oMpMT9uMTlOw/UIhl6mKCMPMw4M3dX1Q2kHPn7Ge1S9sUGEotc/XUWk6GSX57Y 39jnYv7PoBtqm63M8PWaSUuCl8z46lrkKhyNnkVT0PcDbSv7EL2LtC9CVDgZTyQCovle 0HJFqUIIm8dggx3gXGPXikmz3S+Qh3zzol3lKn+m1IlpIUHSZujLKuST+wQMOmQV7/RP OqhPKvSt4ZDkjtm70RrH+AYWt5QV+KalXnLXwQTLm2CuIkKhc4Kt7lARvfEh+y0sSUhk +95A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=aT2Mjvn64OpVhHB9XBny4RRZsVe/z+J5b+ycf24+Buk=; b=ZMm5rI15KPNkeA7lfVFk+AA4dMxPYNBqSh9n674Tp3zWlzUl6xI477BCAhQYkTMgA0 deLYDLFbH+W0jogbDyKiJP8u1AUlgGWTMS3OsCm9CS3qIA2ocvFOyMuxsc5HKiPiHsxu 3mTVE34rfgWwPgROc2x67Byx6SaOPnnnixprBPVpTdPRTbjV8Ecb7vb4EZzrFqeDJ5yn ZH3zAL9JkbiAy2d0C/XkyFfMsnvdSOHNxby36nnavLe6pAIOWX+NNgKO/rWlaW0x9Auf dNPU45vSMV5UI6IOCVpyUlleJfRaKQE0YqWQS6lPW/Ya7cPEwkDJp1acT8OlfTSdDnec 8lFw== X-Gm-Message-State: ALoCoQkvyah40kPNayGbdnOh27zKSsoy+qZlcBcq+6JimBoxiqiwcQI6+MoVOHrhZAnlzAcKE0fcMV5ObrsD8GVLN/33wYcZSz6ATPey8jyUzud2b7r+74U= MIME-Version: 1.0 X-Received: by 10.194.185.42 with SMTP id ez10mr962196wjc.82.1449596241214; Tue, 08 Dec 2015 09:37:21 -0800 (PST) Sender: sobomax@sippysoft.com Received: by 10.27.39.135 with HTTP; Tue, 8 Dec 2015 09:37:21 -0800 (PST) In-Reply-To: <201512081701.tB8H1ivY009763@hergotha.csail.mit.edu> References: <201512081701.tB8H1ivY009763@hergotha.csail.mit.edu> Date: Tue, 8 Dec 2015 09:37:21 -0800 X-Google-Sender-Auth: vwKGwcdtcjd5E8BYRUabTjnjh00 Message-ID: Subject: Re: posix_fallocate(2) && posix_fadvise(2) are somewhat broken From: Maxim Sobolev To: Garrett Wollman Cc: freebsd-current@freebsd.org, freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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:37:24 -0000 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 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 > >