From patchwork Tue Dec 10 22:26:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Eggert X-Patchwork-Id: 36696 Received: (qmail 60556 invoked by alias); 10 Dec 2019 22:26:48 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 60548 invoked by uid 89); 10 Dec 2019 22:26:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_PASS autolearn=ham version=3.3.1 spammy=H*r:10026, Say, H*f:sk:5337dac, H*i:sk:87muc05 X-HELO: zimbra.cs.ucla.edu Subject: Re: [PATCH] manual: fopen with the x flag does not follow ISO C11 To: Florian Weimer Cc: libc-alpha@sourceware.org References: <877e3571jh.fsf@oldenburg2.str.redhat.com> <5337dac7-77ad-85d2-e3ba-254e6f41e468@cs.ucla.edu> <87muc05q87.fsf@oldenburg2.str.redhat.com> From: Paul Eggert Message-ID: Date: Tue, 10 Dec 2019 14:26:44 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <87muc05q87.fsf@oldenburg2.str.redhat.com> On 12/10/19 4:18 AM, Florian Weimer wrote: > I think it is worth clarifying that glibc's x specifier only results in > O_EXCL and nothing else. Although the glibc manual already says "x" means O_EXCL, I agree it'd be nice for it to also say that this behavior is compatible with ISO C. That is, the manual shouldn't imply that some standards require behavior other than O_EXCL. How about the attached patch? A different topic: shouldn't the manual refer to ISO C18 (the current version of the C standard) rather than to ISO C11 (the previous one)? From 20e37c044d4ebbaf593117364d8ad995c7628c2a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 10 Dec 2019 14:22:36 -0800 Subject: [PATCH] manual: clarify fopen with the x flag * manual/stdio.texi (Opening Streams): Say how glibc's implementation of fopen with "x" follows ISO C11. --- manual/stdio.texi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manual/stdio.texi b/manual/stdio.texi index bbd3061bab..5caeacf595 100644 --- a/manual/stdio.texi +++ b/manual/stdio.texi @@ -216,7 +216,9 @@ exists, @code{fopen} fails rather than opening it. If you use file. This is equivalent to the @code{O_EXCL} option to the @code{open} function (@pxref{Opening and Closing Files}). -The @samp{x} modifier is part of @w{ISO C11}. +The @samp{x} modifier is part of @w{ISO C11}, which says the file is +created with exclusive access; in @theglibc{} this means the +equivalent of @code{O_EXCL}, which is common practice. @end table The character @samp{b} in @var{opentype} has a standard meaning; it -- 2.23.0