From owner-freebsd-standards@FreeBSD.ORG Thu Jan 23 15:36:22 2014 Return-Path: Delivered-To: standards@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 152A81BC for ; Thu, 23 Jan 2014 15:36:22 +0000 (UTC) Received: from mail-qa0-x236.google.com (mail-qa0-x236.google.com [IPv6:2607:f8b0:400d:c00::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C4B1919E5 for ; Thu, 23 Jan 2014 15:36:21 +0000 (UTC) Received: by mail-qa0-f54.google.com with SMTP id i13so2330620qae.41 for ; Thu, 23 Jan 2014 07:36:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ghiAknQiGTdHij77VQhtkUc+jMpWiTfgZbs4wO8gVro=; b=GnV7Ab8ZPDyqh3V3jnFyzTICAuYa+sXoESJVO7WSiVMnrReI6Ic+OZzYuPz6zLf0is p4unZvGk2dKCYKEixPZzmmUnwFfAmmyZFNhBPtqFysuJ7EqE07k25I0xSG0Os4Aa7P1a DowzMukFN8Z/VIlIleNPZrjvBN15rS7BmxI4nRUN3W1Uhy12H73JmnKuHwlzOJSmEGLx AtKauqDZaS/yPZioaNJn3HXBo/cDf85vZnU035TCWIFwcATXzY5dQ9F91ZG/F4uSSepk 5UUr6xXsjK0I5Y0P/bOLxwTVRML7PkjHI+NP+pa3c9zgxAFyDzUbMw1mGADk8/WpNzgq lClw== MIME-Version: 1.0 X-Received: by 10.224.70.84 with SMTP id c20mr12298857qaj.48.1390491380995; Thu, 23 Jan 2014 07:36:20 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.229.216.135 with HTTP; Thu, 23 Jan 2014 07:36:20 -0800 (PST) In-Reply-To: <20140124014043.T879@besplex.bde.org> References: <201401230858.s0N8wwQB039907@oldred.freebsd.org> <20140123094017.GH24664@kib.kiev.ua> <20140124014043.T879@besplex.bde.org> Date: Thu, 23 Jan 2014 07:36:20 -0800 X-Google-Sender-Auth: IHDceQKachnN1iloWuvbKFW8x4w Message-ID: Subject: Re: standards/186028: incorrect return values for posix_fallocate() From: Matthew Fleming To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: Gennady Proskurin , standards@freebsd.org X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jan 2014 15:36:22 -0000 On Thu, Jan 23, 2014 at 7:08 AM, Bruce Evans wrote: > On Thu, 23 Jan 2014, Konstantin Belousov wrote: > > Indeed. Linux also seems to have the conforming behaviour, according >> to their man page, which also explicitely states that errno is not set. >> >> Try this. >> >> diff --git a/lib/libc/sys/posix_fallocate.2 b/lib/libc/sys/posix_ >> fallocate.2 >> index 087c68c..ee6fcc4 100644 >> --- a/lib/libc/sys/posix_fallocate.2 >> +++ b/lib/libc/sys/posix_fallocate.2 >> @@ -83,9 +83,9 @@ that reduces the file size to a size smaller than >> If successful, >> .Fn posix_fallocate >> returns zero. >> -It returns -1 on failure, and sets >> +It returns error on failure, without setting >> .Va errno >> -to indicate the error. >> +variable. >> > > "returns error" is hard to parse. Only values can be returned. > > The old text would have had a style bug if it had been correct. Normal > man pages use the mdoc markup ".Rv -std" instead of repeating the above > boilerplate ad nauseum to describe standard error handling. In libc/sys, > the macro is used in 106 man pages and the style bug is used in about > 50 man pages. Oops! I guess I didn't read the POSIX spec very carefully; my mental model is that only the pthread_* functions directly return the error, and others follow the old UNIX behaviour of returning -1 and setting errno. Anyways, the patch looks fine to me. Sorry for any errors in the man page as well; I never was able to find a guide to all the various mdoc macros so I had to work from examples. Cheers, matthew