From patchwork Fri Nov 3 21:37:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 834117 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-86725-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Nz6p1rGF"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yTFfh63l3z9s7C for ; Sat, 4 Nov 2017 08:37:32 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; q=dns; s=default; b= KEBSQ+DDZe45Rax6+YVylMPKhw3mAei/5SWYKNAeU9/03Sj/0b49bIHZc1GaZ6ld 1I6Llz3LcJFWDsM5uWI/R0E8zLj/LGDbL8tXkP+B++X3W7FzG8zwyTO3rXDOYmla ljUMSVoM2RZyd5nU1EHcuocSpAYg6hyk26ggNwdgpe0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; s=default; bh=84+z5E MLKdH0pcKomDOZ3Hwkkh8=; b=Nz6p1rGFuQbdl5N3f26t4BzK0dDkrjnL1DlYAs PNvsC8ip4026Ec8U9kNb6DRCU0bq0xwvE0ND2R37qh8Wol3sP2Q8N0CgzJlTHvlX aVeeeU2Ss9YJqGX7t9uGziEIgCwBIl2wdCGfAt9M8mTnBdS7TKt9VLu5ofrcYv8g bf/vE= Received: (qmail 11409 invoked by alias); 3 Nov 2017 21:37:17 -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 11373 invoked by uid 89); 3 Nov 2017 21:37:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1428, family X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 61173C058EC2 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer@redhat.com Date: Fri, 03 Nov 2017 22:37:14 +0100 To: libc-alpha@sourceware.org Subject: [PATCH] manual: Document the O_TMPFILE flag User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20171103213714.8303C41F1E4EF@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) 2017-11-03 Florian Weimer * manual/llio.texi (Open-time Flags): Document O_TMPFILE. Reviewed-by: Jonathan Nieder diff --git a/manual/llio.texi b/manual/llio.texi index e72c53c785..b2123beefe 100644 --- a/manual/llio.texi +++ b/manual/llio.texi @@ -3478,6 +3478,25 @@ If set, the file will be created if it doesn't already exist. If both @code{O_CREAT} and @code{O_EXCL} are set, then @code{open} fails if the specified file already exists. This is guaranteed to never clobber an existing file. + +The @code{O_EXCL} flag has a special meaning in combination with +@code{O_TMPFILE}; see below. +@end deftypevr + +@deftypevr Macro int O_TMPFILE +@standards{GNU, fcntl.h} If this flag is specified, functions in the +@code{open} family create an unnamed temporary file in the directory +@var{filename}. The @code{O_TMPFILE} flag must be combined with +@code{O_WRONLY} or @code{O_RDWR}, and the @var{mode} argument is +required. The file can later be given a name using @code{linkat}. To +prevent that, specify the @code{O_EXCL} flag at open time. + +Not all kernels support this open flag. If this flag is unsupported, +the function call fails with an error of @code{EINVAL}. If the +underlying file system does not support the @code{O_TMPFILE} flag, an +@code{EOPNOTSUPP} error is the result. + +The @code{O_TMPFILE} flag is a GNU extension. @end deftypevr @deftypevr Macro int O_NONBLOCK