From patchwork Mon Dec 9 19:16:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 36674 Received: (qmail 87620 invoked by alias); 9 Dec 2019 19:16:10 -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 87611 invoked by uid 89); 9 Dec 2019 19:16:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT autolearn=ham version=3.3.1 spammy=mandatory, modifier, @samp, 2167 X-HELO: us-smtp-delivery-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575918966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FSOcFy8b+C1zYXXuO7A9ip+xcnEmy/16zDAXfCYDjyA=; b=S6YDU0uFdochxd4Pgm6SsOW9vQ3KzU0KIPVyPbpdcPnZ07Hg8Y2ANPN0xjwt6+HYYFGwpm CQJAUhlQFf5EAN6PIRpCY1iDqPaKWSchDuHMjymc/tCUfjQDqX6lKmxtVZXNWGZ/6YPAyP e4oDV2lUxaofjDY/0AIMOPVSdxIpCvM= From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH] manual: fopen with the x flag does not follow ISO C11 Date: Mon, 09 Dec 2019 20:16:02 +0100 Message-ID: <877e3571jh.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 ISO C11 requires that the new file is created locked, something that our implementation does not do. Changing that would impact backwards compatibility, particularly if the C11 requirement of “exclusive (also known as non-shared) access to the extent that the underlying system supports exclusive access” is read to imply mandatory locking. ----- manual/stdio.texi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manual/stdio.texi b/manual/stdio.texi index bbd3061bab..33a0250a9a 100644 --- a/manual/stdio.texi +++ b/manual/stdio.texi @@ -216,7 +216,11 @@ 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}. +@strong{Portability Note:} Some standards describe the @samp{x} +specifier with different semantics, requiring that exclusive, +mandatory file locking is enabled for the new file. The +implementation in @theglibc{} follows existing practice and only +passes the @code{O_EXCL} flag to the kernel. @end table The character @samp{b} in @var{opentype} has a standard meaning; it