From patchwork Fri Nov 3 21:37:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 834116 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-86724-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="h3bLgki3"; 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 3yTFfW2mJ7z9s7C for ; Sat, 4 Nov 2017 08:37:23 +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= L4lS5bMN5QvFs7X5YchtcP+aS1siQI40RhRBI9T2HoOjiy407CE3DeXbK9GfzHFS Z9nPgEW1BbcGTi8dHgOVUFBlFsA6J+Pn6ByrF4pjYxRO4bM6/Le3wR0sZT+WmSNs rCGjA9OZW4DQrSlC4wHi8/G6TR/JOR4I/fYtW2oTdGU= 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=7wKxVg mwY2FeoOztYlYrAFLv+64=; b=h3bLgki31ZcYIT16ARk/ITxx1jBKY3GhsV/Dgz ihqYZLlch4FIte6HQNFPNuAsuF5oAm1+w02/2wgwh4b/Ppe2nnm1lbTNwa/VNRoA 5q+WwDTxLLYCPxV2EjRZiDQwsfqJE6VDn8VAlT9Ud5Fp5kiItbzM+2L6RH7kBDmv gHghI= Received: (qmail 11255 invoked by alias); 3 Nov 2017 21:37:16 -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 11245 invoked by uid 89); 3 Nov 2017 21:37:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hard, Links, assessment X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 48B5A356D7 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer@redhat.com Date: Fri, 03 Nov 2017 22:37:12 +0100 To: libc-alpha@sourceware.org Subject: [PATCH] manual: Document the linkat function User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20171103213712.ED59B41F1E4EF@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) 2017-11-03 Florian Weimer * manual/filesys.texi (Hard Links): Document linkat. Reviewed-by: Jonathan Nieder diff --git a/manual/filesys.texi b/manual/filesys.texi index 5f7eb0e231..a364c373b2 100644 --- a/manual/filesys.texi +++ b/manual/filesys.texi @@ -1205,6 +1205,35 @@ A hardware error occurred while trying to read or write the to filesystem. @end table @end deftypefun +@deftypefun int linkat (int olfd, const char *@var{oldname}, int newfd, const char *@var{newname}, int flags) +@standards{POSIX.1, unistd.h} +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} + +The @code{linkat} function is analogous to the @code{link} function, +except that it identifies its source and target using a combination of a +file descriptor (referring to a directory) and a pathname. If a +pathnames is not absolute, it is resolved relative to the corresponding +file descriptor. The special file descriptor @code{AT_FDCWD} denotes +the current directory. + +The @var{flags} argument is a combination of the following flags: + +@table @code +@item AT_SYMLINK_FOLLOW +If the source path denoted by @var{oldfd} and @var{oldname} is a +symbolic link, @code{linkat} follows the symbolic link and creates a +link to its target. If the flag is not set, a link for the symbolic +link itself is created; this is not supported by all file systems and +@code{linkat} can fail in this case. + +@item AT_EMPTY_PATH +If this flag is specified, @var{oldname} can be an empty string. In +this case, a new link to the file denoted by the descriptor @var{oldfd} +is created, which may have been opened with @code{O_PATH} or +@code{O_TMPFILE}. This flag is a GNU extension. +@end table +@end deftypefun + @node Symbolic Links @section Symbolic Links @cindex soft link @@ -3515,7 +3544,6 @@ The @code{mkdtemp} function comes from OpenBSD. @c fchownat @c futimesat @c fstatat (there's a commented-out safety assessment for this one) -@c linkat @c mkdirat @c mkfifoat @c name_to_handle_at