From owner-freebsd-hackers@freebsd.org Tue Dec 8 17:59:52 2015 Return-Path: Delivered-To: freebsd-hackers@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 BB2749D4DB3 for ; Tue, 8 Dec 2015 17:59:52 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (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 534F314B2 for ; Tue, 8 Dec 2015 17:59:52 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by wmec201 with SMTP id c201so40196636wme.1 for ; Tue, 08 Dec 2015 09:59:50 -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=QPLy10ZJP5pFmUQO/g2lwDAKV5nOfehBd2SRL0SqawY=; b=z59Nxo7RlQDBhIU69VZ4ls+e9OPJqHIDbG15uIu+Aj8Jk/biFMbMWADyzF1TnotrSi 68YkfDM//rPI4b/hucAKz4Ek1ttWKadd6qkWI/fGMkeV57RY8WW/mJbJBN4DSSvNeTCg nk+iqRIylsL8+Noy9gX/7B8CY3kbXLpHaUsXZKJ5cRRuZAC27bGU+LTua1BxuRKTrzYr mTHP0o03w5zsmRWMl2yrRrxIIp/3Hl3zXlulyClxf0ckDZBlJaQDkj/kx436d4t60tS6 Z9tWVqkYdoGuLcqPkTcDOc62WulD/aop4+LeSGPxeql1Aq1bqqK6Y1OPzEltmNYI6VD0 PEHA== 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=QPLy10ZJP5pFmUQO/g2lwDAKV5nOfehBd2SRL0SqawY=; b=Riv6XmMF71PSfBrgWWvnqVw/VOwh0fvwuTZvoEndHilOfsTEfg+BCqXoxHEVYIDFbX nqCQR/gXGCFs+//fepYFxwf7htJjBms3IkK+Q7P8alIa2TyKDLTF0sdn75w7dGuj0VNg g6/XNRIwyM98VYOQEGOj8gCOdQKYkU9ZcCn8Th4eO4tvY/5eZzawZ7Qxwsdne2bldXMA mql8CxYFL/fRzhuZWPFocNeHP9Mclqey9RFnfKg62kvyaYe8DV4pr2p488dVvPQSmQNw V40WPAPRYsmhe7SYQPh9nDYk7c335SoIM2SRxoENgxT/j6bY+UAx8tZobBzLeSmCdDUL Rhvg== X-Gm-Message-State: ALoCoQl3QwmdvtvUTTBE+2OKFl9tOaZmf8arczkK/1r6gPX62Ms3zgaoODhje9u2eS640qJzONfmV7slB9qJwMPV6CVici0Ic+BuMS7uQ29OxXUBg25HL3c= MIME-Version: 1.0 X-Received: by 10.194.185.42 with SMTP id ez10mr1089745wjc.82.1449597590817; Tue, 08 Dec 2015 09:59:50 -0800 (PST) Sender: sobomax@sippysoft.com Received: by 10.27.39.135 with HTTP; Tue, 8 Dec 2015 09:59:50 -0800 (PST) In-Reply-To: <20151208174259.GA82577@kib.kiev.ua> References: <868u55rl96.fsf@desk.des.no> <20151208174259.GA82577@kib.kiev.ua> Date: Tue, 8 Dec 2015 09:59:50 -0800 X-Google-Sender-Auth: bMK13KdHMtYrxp7Jo9MAO3VtXQU Message-ID: Subject: Re: posix_fallocate(2) && posix_fadvise(2) are somewhat broken From: Maxim Sobolev To: Konstantin Belousov 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-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 17:59:52 -0000 Ah, ok, I see now. It's been broken and still broken in 9.x/10.x, already fixed in trunk and I been just reading wrong manpage. Thanks for the pointer, on a related note those fixes should probably be MFCed into 10.3 if it has not been already. On Tue, Dec 8, 2015 at 9:42 AM, Konstantin Belousov wrote: > On Tue, Dec 08, 2015 at 04:52:05PM +0100, Dag-Erling Sm??rgrav wrote: > > Maxim Sobolev 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, > > > i.e. posix_fadvise() returns 22 on EINVAL. > > > > That's how syscalls work. > > No, this is not how typical syscalls work, but is how the posix_fallocate() > and posix_fadvise() are specified by Posix. The patch is wrong, see also > r261080 and r288640. > >