From patchwork Mon Jan 6 16:26:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 104189 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5EF593858C2B for ; Mon, 6 Jan 2025 16:38:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5EF593858C2B Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Yn+QN+cO X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 371623858D28 for ; Mon, 6 Jan 2025 16:33:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 371623858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 371623858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736181188; cv=none; b=ZFgnboUalK/3zFeIxT56nw34HhOtxpiA6aK3hIInyQF1rVrKCbM4VfH28CnH5kdSrm/jo0EUTFPAxHVRAIaXdresEsT48Ote22Y/j2dxpavWffUttPC4gstXqDqA7we3tdurcUHc9OyQ0h20uVPYwwrkEzOQZXqnyvAZfR2arIY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736181188; c=relaxed/simple; bh=K4xxr2C6zb9f8BTZGUvPZRZtFXu0fLx4VaZNUazYfrE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=tH0OMW4Y7bLrmGKlrcBrH744OLuKr6AIuQKjdAiFb8dXPaUqOzAq2Sr0TVLDcZJOfHVKahtCKFOYqKyf+7y8Lj7f+f9MQrH3Ajq5tpg2mvuQPdb8imul/8akv+9gbPBYNlfbSsA1w+i5bZ3ijSQykC+rBJ4FyniHptPOsKU7Mic= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 371623858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736181188; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sZSJHG6Z7Cm0GJ3bb3iBNBr3D1p4icqYWMXMQMtNE48=; b=Yn+QN+cOFe6/f1z744Wv4YvbxOJUCTq8FYtFUdwb5uH42QZ0+7AKz2TAi8KwG3C1zNAmfu r8Z+qZGjwzPjI4p/yDKpn6afFXF8GU+zyfWOnPxIP3y2FhcdduNNit6Ez5QYwRzamLRooe nI49lBygn4MyOv5aKt1wDERwldV8H5U= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-478-1gNrk8YWP96jvaUWFDx8Ow-1; Mon, 06 Jan 2025 11:33:07 -0500 X-MC-Unique: 1gNrk8YWP96jvaUWFDx8Ow-1 X-Mimecast-MFC-AGG-ID: 1gNrk8YWP96jvaUWFDx8Ow Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-467bbc77b05so315145601cf.0 for ; Mon, 06 Jan 2025 08:33:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736181186; x=1736785986; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sZSJHG6Z7Cm0GJ3bb3iBNBr3D1p4icqYWMXMQMtNE48=; b=K2xJu8JSbcnrdLBT525OW5ivSfneB8AXRgw9MjaD6NX9pm+GwTfJoYFX8DRCbGBagU 5flhM/0XDB+c/z2NvJE62KtDGvdXwA1UgYaqyYSkIXR1Iz/2h8+rXDc+hCdjZ9bnl7Rr uvNO50AbBLYCkZrLivMJujM25E8u8Rf41B2hWxeBwAs7mWFwzNyNF0GArdEfCQI3Qgel aqNYUmXVuFIHZ4XnC/XbsP+8nABsoaEUZ3UC80fKEWBZtTIE5JFpyDoLfDDtSKlUyhQf IGuHtqUZitlJuPIII5E2S2WnJ5jI2VkcU4v/wfftU7jrXKqMf7UXd/6tXohLsIVLgbJJ VKpA== X-Gm-Message-State: AOJu0YxncdsMF9Q9x2nHxUu28L9MTUCcLVjmYxeazlE7L436bO6jXfh0 1ilol0vlRYI201q250sSsZsJsE1Vps4r7xV2zqs2KXRuZ27j3tCaVNnEVEaJ30wRhJKiQ4DjiQq /zTbLf9pqVCrlUBanWGVdcIF/CpK+rAvij7T/KCV/XZnrFTSphjEXHIL4Jx5ZPaOXY0qQorZWmk RZB0tLlUSmkecoWafIqRx5pZXkWV0QXlt3qTidsA== X-Gm-Gg: ASbGncsQHh79Z+YdunpXxN4xXf7uPOd4UI2F8BnftF4ioO4r24OM792SPmkI5cPgivY k8PD7ANfbPhf6WZvYq34zpyQA5DrJne/eYmKe0KnFclT2JqzFzNMtvGFht9EIjQc5xurfd4I7ij QWxaQHhrl2bAg4Qjzo1rjBzn/cKucQHErcVl/GzmrcB2kOqVsA9f19cMieIFPDFzeG0kbMfq+MC 68XUivj+bF2BSkSl4rKVRS2xfGvyWd6B01aClKY+co/M8KFa+eSbZioMu3AUoioLOFfSJmo5H7S j6O8ZVdFg5geaq/qybSkXI38 X-Received: by 2002:a05:622a:11ca:b0:466:a6e5:6f0f with SMTP id d75a77b69052e-46a4a8c5ae1mr1120148111cf.4.1736181185822; Mon, 06 Jan 2025 08:33:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfkr/IvBfJKqJZvLn3Xr815CilpIoxHKVt4G7lezwpRQuDYTld80ZLqJhGM+lITKaIJOPd7A== X-Received: by 2002:a05:622a:11ca:b0:466:a6e5:6f0f with SMTP id d75a77b69052e-46a4a8c5ae1mr1120147531cf.4.1736181185329; Mon, 06 Jan 2025 08:33:05 -0800 (PST) Received: from x1carbon9g.redhat.com (ip-94-112-226-240.bb.vodafone.cz. [94.112.226.240]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-46a3e67e361sm176664841cf.31.2025.01.06.08.33.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 08:33:04 -0800 (PST) From: Arjun Shankar To: libc-alpha@sourceware.org Cc: Arjun Shankar Subject: [PATCH v2 1/5] manual: Document faccessat Date: Mon, 6 Jan 2025 17:26:06 +0100 Message-ID: <20250106163257.705106-2-arjun@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250106163257.705106-1-arjun@redhat.com> References: <20250106163257.705106-1-arjun@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: yzjLpySdrtSvhsnYzkxviv5jmx05FhbDO8HoX_9Ii4U_1736181186 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org This commit adds a note that the Descriptor-Relative Access section does not list all flags, then documents `faccessat' along with the AT_EACCESS flag specific to this function. Reviewed-by: Florian Weimer --- manual/filesys.texi | 53 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/manual/filesys.texi b/manual/filesys.texi index aabb68385b..407c26bd76 100644 --- a/manual/filesys.texi +++ b/manual/filesys.texi @@ -310,12 +310,17 @@ This is a GNU extension. The flags argument in @code{@dots{}at} functions can be a combination of the following flags, defined in @file{fcntl.h}. Not all such functions support all flags, and some (such as @code{openat}) do not accept a -flags argument at all. - -In the flag descriptions below, the @dfn{effective final path component} -refers to the final component (basename) of the full path constructed -from the descriptor and file name arguments, using file name lookup, as -described above. +flags argument at all. Although the flags specific to each function have +distinct values from each other, some flags (relevant to different +functions) might share the same value and therefore are not guaranteed to +have unique values. + +A non-exhaustive list of common flags and their descriptions follows. Flags +specific to a function are described alongside the function itself. In +these flag descriptions, the @dfn{effective final path component} refers to +the final component (basename) of the full path constructed from the +descriptor and file name arguments, using file name lookup, as described +above. @vtable @code @item AT_EMPTY_PATH @@ -2980,6 +2985,41 @@ Flag meaning test for execute/search permission. Flag meaning test for existence of the file. @end deftypevr +@deftypefun int faccessat (int @var{filedes}, const char *@var{filename}, int @var{how}, int @var{flags}) +@standards{POSIX.1-2008, unistd.h} +@comment Unaudited and therefore marked AC-Unsafe and AS-Unsafe by default +@safety{@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} +This function is a descriptor-relative version of the @code{access} +function above. @xref{Descriptor-Relative Access}. The @var{flags} +argument can contain a combination of the flags @code{AT_EACCESS} described +below, @code{AT_EMPTY_PATH}, and @code{AT_SYMLINK_NOFOLLOW}. + +@vtable @code +@item AT_EACCESS +This flag when passed to the @code{faccessat} function causes it to perform +access checks using effective user and group IDs instead of real IDs, which +is the default and matches the @code{access} function. +@end vtable + +Compared to @code{access}, the following additional error conditions can +occur: + +@table @code +@item EBADF +The @var{filedes} argument is not a valid file descriptor. + +@item EINVAL +The @var{flags} argument is not valid for this function. + +@item ENOTDIR +The descriptor @var{filedes} is not associated with a directory, and +@var{filename} is a relative file name. +@end table + +This function may not work correctly on older kernels missing the +@code{faccessat2} system call. +@end deftypefun + @node File Times @subsection File Times @@ -3760,7 +3800,6 @@ creation always works like @code{open} with @code{O_EXCL}. The @code{mkdtemp} function comes from OpenBSD. @c FIXME these are undocumented: -@c faccessat @c fchmodat @c fchownat @c futimesat From patchwork Mon Jan 6 16:26:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 104187 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 682BC3858D35 for ; Mon, 6 Jan 2025 16:35:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 682BC3858D35 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=MEQwD9Oq X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id C3C5D3858D29 for ; Mon, 6 Jan 2025 16:33:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C3C5D3858D29 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C3C5D3858D29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736181189; cv=none; b=pQejO2BW0RNKSM8yAAw/US7vtXCADRDqjhupmAOi+xk0D6CfeaZCxUG94xKZX5q7p1XtuQvoQWwyuCN3e+nyvJbY3eUOSDWdh/9KH9ENais+nJbtMlsnDl85xzCz9ZvkLrn7oyTXpzHPDLD6ttMchS5QihoLW842QlZQyekW5ds= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736181189; c=relaxed/simple; bh=/EJMiXqjkcBp5NSezly0VzOgIU2hnVJZEJgFG0gaJlc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=AYortNjZYOAMlrdozE1gFhHtcixL6u8/dtHCxfVKdct1cx9iMtB06/QiBu8wUtRjCicRXqGYpDYxKHt2iCToIulJ3nt3+twHYjf1ZuaGHuQsbi4X5iibl/ZycH5nBAXJbYDzTNFuKsJLPumQwa8EGCoANF8E3OQ0soRTjl6HRvU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3C5D3858D29 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736181189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Bc7wbjvLJdt9FkE46Tgtq1va/KDYzzJNdfZz6q8EdS0=; b=MEQwD9OqjTT6n71kRXx0fxM9Dr31Tf2uRwc4sByRKeZ/2y70oewif1FXohqz8OTYK6ueDr dxY+wy/rh9SVTZ+pTBYfaoqEsHaqKXlm/pHEkHO3PpmnNRUsBgieeptqCYdrmz6q8VlFUf aUY124AIKYlhq5jG1c55C7lBiubFy8Y= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-630-uzEimukGOr-l6gmdQsOuzA-1; Mon, 06 Jan 2025 11:33:08 -0500 X-MC-Unique: uzEimukGOr-l6gmdQsOuzA-1 X-Mimecast-MFC-AGG-ID: uzEimukGOr-l6gmdQsOuzA Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-6d8edb40083so287917496d6.0 for ; Mon, 06 Jan 2025 08:33:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736181188; x=1736785988; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bc7wbjvLJdt9FkE46Tgtq1va/KDYzzJNdfZz6q8EdS0=; b=JACKjAV5ztLWtqLtnpLRlrQUt9WJXadBRV66SeZoh0h/1ldgq7wn4Lb5SdQ0GQ5TUr WyWk11RPRDi9dbbv3tlwkR3R/ktWBjeULoeYSnBa/hPzTpmNA7DHR+n4+Qkz+StIY2E3 sGfEhgYZgbvlzWtWA8dC4c3US4N2eKVvK6jcwgbN4gQVIDSJZH90fb9L5qqtiEQFtNo2 CUY+mxfW7FHBcUlUzlAfMJCYgtNcCPk4tYTkRybr54g0T6i864elkN5MymkTHaQc5Fm1 ZwCdijjhnEEQ3KhKI8SWQTjRJ41b9zG8IyABhOKZvMvxya3ozdb7nSOq48vlnFHR8ZMg CiiA== X-Gm-Message-State: AOJu0YypGOvLhZG1c+6h0IikbO+2AjoJKZc5VfJ1KFUhx/p3/Ne3l++M d0yIx7RRozeEZ2UuDHQHvi6GZBtmtAwl2qz+nCfIYndKVo/gmxUwgH+JHfIqIghrXXSyT8rl5cB jS/1+aoATQa33Pprz46Q6KMaEmtTKFQJoGoSbUJqcNr7vPvv3rvlumKz+UKqQ+hyoKL1emzp0Sf YDtyyxgp8ksx8XymGjbUC++bJPk/cpdXPzt/lHqA== X-Gm-Gg: ASbGncsBzZ1sjAjbbwOWSaN/tEHF1bNdTtYPbisxRFMZr5HQplyREfeBb0/Xlxdnj41 j01DdXHdmBtSV+tCHdw7m2MBp+0FfnDavO0X0eZ45r3mD1OLcPFQEqqiYPvZXu+evR0xQ5ZTnIq jacGthrBtMLwxc2SmOD4Y5aK02uuuauAxh8/dwulk5HHuP3MXV3SShiPsmEbB6wyJv9i1pOschb H1fYIC4tqpYbpN612fw6VrUIHNs5L7/0qhcKNyYt778spUU1BBe5dlypvRD9HJhdOQdzgt/nKmH DqeXntZZ+Y+B6sLNkYeTSYjD X-Received: by 2002:ac8:7c4c:0:b0:467:64eb:f2f2 with SMTP id d75a77b69052e-46a4b1120famr1031782131cf.9.1736181187951; Mon, 06 Jan 2025 08:33:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjlYJWAh8xrttPcAeo9R1WJDZnahWfpGrIY+c39AZiY6Scm29zYwxZDoKe6ZKxm90sN7YlWw== X-Received: by 2002:ac8:7c4c:0:b0:467:64eb:f2f2 with SMTP id d75a77b69052e-46a4b1120famr1031781671cf.9.1736181187560; Mon, 06 Jan 2025 08:33:07 -0800 (PST) Received: from x1carbon9g.redhat.com (ip-94-112-226-240.bb.vodafone.cz. [94.112.226.240]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-46a3e67e361sm176664841cf.31.2025.01.06.08.33.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 08:33:06 -0800 (PST) From: Arjun Shankar To: libc-alpha@sourceware.org Cc: Arjun Shankar Subject: [PATCH v2 2/5] manual: Document mkdirat Date: Mon, 6 Jan 2025 17:26:07 +0100 Message-ID: <20250106163257.705106-3-arjun@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250106163257.705106-1-arjun@redhat.com> References: <20250106163257.705106-1-arjun@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: x7oTEGganmgdr3Q4Y2UCX_Xel8jx4LV-byevJReUAXc_1736181188 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org --- manual/filesys.texi | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/manual/filesys.texi b/manual/filesys.texi index 407c26bd76..e92730209c 100644 --- a/manual/filesys.texi +++ b/manual/filesys.texi @@ -1880,6 +1880,26 @@ To use this function, your program should include the header file @pindex sys/stat.h @end deftypefun +@deftypefun int mkdirat (int @var{filedes}, const char *@var{filename}, mode_t @var{mode}) +@standards{POSIX.1-2008, sys/stat.h} +@comment Unaudited and therefore marked AC-Unsafe and AS-Unsafe by default +@safety{@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} +This function is a descriptor-relative version of the @code{mkdir} +function above. @xref{Descriptor-Relative Access}. + +Compared to @code{mkdir}, the following additional error conditions can +occur: + +@table @code +@item EBADF +The @var{filedes} argument is not a valid file descriptor. + +@item ENOTDIR +The descriptor @var{filedes} is not associated with a directory, and +@var{filename} is a relative file name. +@end table +@end deftypefun + @node File Attributes @section File Attributes @@ -3805,7 +3825,6 @@ The @code{mkdtemp} function comes from OpenBSD. @c futimesat @c fstatat (there's a commented-out safety assessment for this one) @c statx -@c mkdirat @c mkfifoat @c name_to_handle_at @c openat From patchwork Mon Jan 6 16:26:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 104190 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 924773858C56 for ; Mon, 6 Jan 2025 16:39:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 924773858C56 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=VirgDp1g X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 4ADD43858D35 for ; Mon, 6 Jan 2025 16:33:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4ADD43858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4ADD43858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736181192; cv=none; b=NtZDn/TiM7necVKFA3buHILrImvpbLY0lB+pTcXzui690z8/YjXOUQUYjY4UCC7p6zTawJHX9ClYFdC3ElfdDSyjnW6geKow3Koz9akV2uRev9ApdVGjjDzWOknWj5VrN8zjFW+D7+PC7zEggYLIKc04r/n+hmHdcCmaSl07+bk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736181192; c=relaxed/simple; bh=IHRLFjOe0wqjwJLI8X6Iboz58rhKJhaerjEuBB9abfM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=S3lBgQht8WJUMLbegkKXcalM+ovS+QG2vV2rAnN1BhL+k3CWp69iT8eiHcupPnB4+uRgNA7mpjo9Z0femFUxkNz0r8FvvdoP30v7nZ0RQ+q+bagM4v/G00G3G32LHeLKjdEX7opQLaxlK2nQ4mvf9x6Es3/AkuZa8QmLV+BL2wc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4ADD43858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736181192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RjukfSGyPv6jMllj8mNYK5UAarhxpxR0ZV+SUFNNOzg=; b=VirgDp1gMuw9+ZW/sKzbUGcDEZA7LARDB9Xkk7pRSuZWVcAfkbaubbNkXrtsMMBQs7bUkE BuDkPaCI4gORwoS5iTujXeQmUeMDSDir4OJUCwtTiJzZAb0Aeb+qhNeW3yJo+/7CXXlxsq Uh7FlLby4yMx6kQ0v6pGhw1GIInkOQI= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-114-k7vthyTaOFO7xx6UeOsKcA-1; Mon, 06 Jan 2025 11:33:10 -0500 X-MC-Unique: k7vthyTaOFO7xx6UeOsKcA-1 X-Mimecast-MFC-AGG-ID: k7vthyTaOFO7xx6UeOsKcA Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6dd43b16631so151241946d6.2 for ; Mon, 06 Jan 2025 08:33:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736181190; x=1736785990; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RjukfSGyPv6jMllj8mNYK5UAarhxpxR0ZV+SUFNNOzg=; b=UCQIPpqyOLmA+0pWo7ZQm7AJwM4o43bCt74EQouGJ4fkYpNjGeqLqz54PmQz+jSRsB h7gjRCFahlLz98yd/x91FlRbcYczNnrDAQ6To9DBitaNZfFxe63W6scwdGWuOfxlgXc8 CMVxyNdyVNLVdWFUc75xANLi/1EjOiC5gSKCbWcK8iCru9z1RFydGOmMqADi6fnAU96j mUvNwu6w67nsIeL0CM72aB7CsQBU/vlxo7VSv9wgAjF+ozp7x00pARA5aNCDUXUZxY5y 2Q+exEp1Zl953gQVcagQrEEDveH/D71UXTdHyaV7xAWUcfak5MH03+awLNoegTyR5egF XvBg== X-Gm-Message-State: AOJu0Yzj9nXCbKLNbNfZRChonldVzOqLLbYDjokSsqIHSGSXlGWF4ajR BjzKKaV/2c+U/Mn0732wegdPJ0hsk1/sYFAD78glJ92/rzxO0pv4t1EQDL/ZXQkL2OrgrCy+f4E RvHZYV0V6xUOXL+49AgdBWmlqX6pSYzOzarVx4YfsEHeRgR/BW0NlX//br+XZ+BzNI/18roBjyJ BRQvFytozT9+KoINwmAlky03vjFzs6PBoElQD0dg== X-Gm-Gg: ASbGncsl8tnEdB3AcaoM0yhVsTKRLksGkPOuY3bb3B0AkiaIpiiKwqY6ecuBzPvmw69 kmXFth7PFCSLDfKHY+iVy5wXTYuNZrfiZq5UhigHGnDpjXWEnIX3wCf7kuq8qM+9Hvq1q9SmOBC p7eATJ0dfeMSZQrZBFjHM55GAGMZbiZTIRwn9P1Iv6Z9pjqKtwTm/EGl2y5uiQRzsHfiA/57Bbo nY+HxPOPAH/OigCgF/kXdbFFI8oMHZcWdtnke4YRje1OydGJTB1JKCj/mdTdHNPcGwMMj5NW1oz mAaKHPqyTBAXCS7IMeHtlsEz X-Received: by 2002:ac8:7f4b:0:b0:466:89f5:c21e with SMTP id d75a77b69052e-46a4a8b6c69mr838153001cf.5.1736181189868; Mon, 06 Jan 2025 08:33:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHEwIhCjeGQUMSZdd1/JTtUyL4F5/Bm6jsX8659pLzAFryU/jbJvlPLR24DAXAcIkED9DK/cw== X-Received: by 2002:ac8:7f4b:0:b0:466:89f5:c21e with SMTP id d75a77b69052e-46a4a8b6c69mr838152611cf.5.1736181189498; Mon, 06 Jan 2025 08:33:09 -0800 (PST) Received: from x1carbon9g.redhat.com (ip-94-112-226-240.bb.vodafone.cz. [94.112.226.240]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-46a3e67e361sm176664841cf.31.2025.01.06.08.33.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 08:33:08 -0800 (PST) From: Arjun Shankar To: libc-alpha@sourceware.org Cc: Arjun Shankar Subject: [PATCH v2 3/5] manual: Document renameat Date: Mon, 6 Jan 2025 17:26:08 +0100 Message-ID: <20250106163257.705106-4-arjun@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250106163257.705106-1-arjun@redhat.com> References: <20250106163257.705106-1-arjun@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: eLSk1mApJ8IkVR3cRrtt9NPfpJMzZ9SZtRz0lzpqx0A_1736181190 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org --- manual/filesys.texi | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/manual/filesys.texi b/manual/filesys.texi index e92730209c..776b98fe7f 100644 --- a/manual/filesys.texi +++ b/manual/filesys.texi @@ -1826,6 +1826,28 @@ file systems. @end table @end deftypefun +@deftypefun int renameat (int @var{oldfiledes}, const char *@var{oldname}, int @var{newfiledes}, const char *@var{newname}) +@standards{POSIX.1-2008, stdio.h} +@comment Unaudited and therefore marked AC-Unsafe and AS-Unsafe by default +@safety{@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} +This function is a descriptor-relative version of the @code{rename} +function above. @xref{Descriptor-Relative Access}. + +Compared to @code{rename}, the following additional error conditions can +occur: + +@table @code +@item EBADF +The @var{oldfiledes} and/or @var{newfiledes} arguments are not valid file +descriptors. + +@item ENOTDIR +The descriptor @var{oldfiledes} is not associated with a directory, and +@var{oldname} is a relative file name, or correspondingly similar condition +for @var{newfiledes} and @var{newname}. +@end table +@end deftypefun + @node Creating Directories @section Creating Directories @cindex creating a directory @@ -3830,7 +3852,6 @@ The @code{mkdtemp} function comes from OpenBSD. @c openat @c open_by_handle_at @c readlinkat -@c renameat @c renameat2 @c scandirat @c symlinkat From patchwork Mon Jan 6 16:26:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 104191 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 708D33858C33 for ; Mon, 6 Jan 2025 16:40:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 708D33858C33 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CkiVvvLD X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 023C73858CD1 for ; Mon, 6 Jan 2025 16:33:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 023C73858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 023C73858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736181194; cv=none; b=DFfbaFK8hKo8hGNq2vHH5GwNZkygq1m+5U8uUYbVRZP0mgXOjjGavCKJZTWiGbnxpUUQIwVM2e6p1VKVdv50nsrIGyrOBMOQHBnVTUxUPcmcGgoUPCsghvrd8ruJ8EEwqjL0zGfd1oO4m4PNeMxA1j+x50YWt2wrbwDFdRzSTU4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736181194; c=relaxed/simple; bh=2goPm42jtOvauiPeVehcqTGtkw1XylskrHeMum0nEa0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=crKAyNSj9m7Abz6wgg0gDXzmcBLJfR4XOfsYJTX9baLXMzTgUqO2jAK8dC4BlEswtPepjB96cqDGdv5tl5ji/t2riRKRZseWoXpqYaYLL63uVN4/QuJvpd5BAu27PcEJkoqPbRklaYm3HdhiC0+8WyjjZEY5p/Q8TU2MExUAvWM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 023C73858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736181193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hd0+9XDydE8QvG6z+1BY2GCfuu/dfbbhehLmk38GUGY=; b=CkiVvvLDrJH6AeBOe2awDotPz8f8hf7wMdct43tjdcRw6Mjx9+n/XR6eS6VZJyqgVewCOj 9Bx1IJeMPvNXJ8/B3abbWoBM99G/Iv3sFr5SxbGQHfTVf11UEiGVWcbEjcIlihRdYRX8zN EANKTZMsoX8kQ6LIhh44RRDO07SmhDQ= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-584-3UpJifDsMPiLLsMTzhJRwg-1; Mon, 06 Jan 2025 11:33:12 -0500 X-MC-Unique: 3UpJifDsMPiLLsMTzhJRwg-1 X-Mimecast-MFC-AGG-ID: 3UpJifDsMPiLLsMTzhJRwg Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-467b5861766so297792711cf.2 for ; Mon, 06 Jan 2025 08:33:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736181192; x=1736785992; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hd0+9XDydE8QvG6z+1BY2GCfuu/dfbbhehLmk38GUGY=; b=dNkEZri3BDg4r0kUvG7hit7LaeDCNMw5MgIIIT7SsbPbp2/Nxz8ulKw6ZtfvPC2Uu8 /oajymcVWzwM5AEWT7ivuqu4pwuSQUQvlZuiCWLAlfhT6lv8UWPf2OnQkCGz10P6896a NwblRD/gZgnklZwymtGysSJ9SJZ8bSD4x53kMc7YHdNNIv7A+ZEGTdtxGrCRaOkCwhh0 e5vQ22ZVe0HYo6Sp6eTvp+WPVlQj/G74/fXSxyDKluYThbqhBOwrCk+LviTJknH3Cz3t K4meurWPy932at4GSh3wa21K9DbpWSJ8aZ7398xp1X+LhqV4+dY8MPKqVcD8phaF98/i K5QQ== X-Gm-Message-State: AOJu0YzItYSNIoDO7UaK7ZzEqk2IC+NL5YVpXsSnfoh5lv46tR2hq8AD wzG4K8AJB0qfyg4+MW8yaVkEEJps3WG2B3rADlzrDuF0DPr/9LYP4POwfYHzZxAzwpAdK8BHTVQ 25oh5NTwQwW2WrRg8qwugjIquMw4dxAejUYp8ZlwyTMgHW829bKD2HO/lPlATpjGpVStIdkqk/e Fh/o+0KFPNI4ia8fGjdCRvVcc9YKXfCs8NRHb8wA== X-Gm-Gg: ASbGncsyE937L0vcNiBSD39aEtOzDF1eMtaCCwlUrCpCDxG5B8WBDhZTM61N249gxbL a5VJT3wOVkBfjK75ot+FkAOG2Wp7Rsgxe8KlAPFj6nP04DCrF4l5+ezPT9yuSzmFGKSNk1ghuKq RESf/o0v95Q2Gwk3S109EyU57pKSFvKS/MOaS/rC2AotLHW7abOQYZJQ5b1a//YzqCs/K/JefYA o8H4EYxf2RBTUBr0c8yCsS6AuTY4ECiVqzlSvDT8Tc932ppPD0Bdtzxif8Je6H7c5FNupXQBVSd GBaXi08nl5WAyuV/6a+rtN7O X-Received: by 2002:ac8:7f8e:0:b0:467:7441:270e with SMTP id d75a77b69052e-46a4a8b2aeemr816706621cf.6.1736181191878; Mon, 06 Jan 2025 08:33:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUo2UKktRmlHOLd9RSc4ryXYaTFjcuIPo9SOMnqGFFx/FHJH7KxVP9YmS1zKftIROxPuB8Mw== X-Received: by 2002:ac8:7f8e:0:b0:467:7441:270e with SMTP id d75a77b69052e-46a4a8b2aeemr816706331cf.6.1736181191516; Mon, 06 Jan 2025 08:33:11 -0800 (PST) Received: from x1carbon9g.redhat.com (ip-94-112-226-240.bb.vodafone.cz. [94.112.226.240]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-46a3e67e361sm176664841cf.31.2025.01.06.08.33.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 08:33:11 -0800 (PST) From: Arjun Shankar To: libc-alpha@sourceware.org Cc: Arjun Shankar Subject: [PATCH v2 4/5] manual: Document unlinkat Date: Mon, 6 Jan 2025 17:26:09 +0100 Message-ID: <20250106163257.705106-5-arjun@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250106163257.705106-1-arjun@redhat.com> References: <20250106163257.705106-1-arjun@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: BV6ndg61XSYVWWVqi5wMHJmTOJdH0lrBfKG8YMkL9nM_1736181192 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org --- manual/filesys.texi | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/manual/filesys.texi b/manual/filesys.texi index 776b98fe7f..ba2f13ef96 100644 --- a/manual/filesys.texi +++ b/manual/filesys.texi @@ -1695,6 +1695,40 @@ file system and can't be modified. @end table @end deftypefun +@deftypefun int unlinkat (int @var{filedes}, const char *@var{filename}, int @var{flags}) +@standards{POSIX.1-2008, unistd.h} +@comment Unaudited and therefore marked AC-Unsafe and AS-Unsafe by default +@safety{@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} +This function is a descriptor-relative version of the @code{unlink} +function above. @xref{Descriptor-Relative Access}. The @var{flags} +argument may either be @code{0} or contain the flag @code{AT_REMOVEDIR}: + +@table @code +@item AT_REMOVEDIR +This flag causes @code{unlinkat} to perform an @code{rmdir} operation on +@code{filename} instead of performing the equivalent of @code{unlink}. +@end table + +Compared to @code{unlink}, the following additional error conditions can +occur: + +@table @code +@item EBADF +The @var{filedes} argument is not a valid file descriptor. + +@item EINVAL +The @var{flags} argument is not valid for this function. + +@item EISDIR +@var{filename} is a directory but the @var{AT_REMOVEDIR} was not passed in +@code{flags}. + +@item ENOTDIR +The descriptor @var{filedes} is not associated with a directory, and +@var{filename} is a relative file name. +@end table +@end deftypefun + @deftypefun int rmdir (const char *@var{filename}) @standards{POSIX.1, unistd.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} @@ -3855,6 +3889,5 @@ The @code{mkdtemp} function comes from OpenBSD. @c renameat2 @c scandirat @c symlinkat -@c unlinkat @c utimensat @c mknodat From patchwork Mon Jan 6 16:26:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 104188 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2E1753858C5F for ; Mon, 6 Jan 2025 16:35:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E1753858C5F Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BfLMAxeM X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 81EE83858C66 for ; Mon, 6 Jan 2025 16:33:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 81EE83858C66 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 81EE83858C66 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736181197; cv=none; b=VazKZsfmo2dcIP6UIspGa1xDoIBblV5dYwoGZjPw6JdzW97vf7PmkjFIjtaww2rZM9+mvUEGsnO9RkXyawsMyM8fJoVfUwM/bS/jR6JcsVwzu/oif7gNfi8rHNFPR6Xl7EjGALzyTVRsYlD8xTdub2BWqugZeh1NaKsoHhL2WjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736181197; c=relaxed/simple; bh=TXN3nqqKuGmKVfcvHOu2zhS+aMqBKwF+XK0tkxMJ3tM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=sgaqtmwNfMi1j21Ut5xVfuHCkxC994IL4AyBe27PqGKuuyIoeAnELyYyV84mvf+CX7xTh+DhXFVHtm3dAAFXSvoUCdt7LJUEIOzvaycrzeHk/bV1ZYAADU4S2v10ktGR5R41ebk0siZa/BcU4+q+jyaFIE1eAM92/XSklUdMPl4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 81EE83858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736181197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nj05/m24/4BxJWa6etxk/u4r0K2E2F4f8k5SgnFKd7M=; b=BfLMAxeMaBNS9qjIDdW31X8AgdJx+0OeC+zxl4uvwYKOTjbqO30cnhfAD9vOhittxKSSbe xL3i0nMKfNQvNM+4LUoc1stKkApWQrRquPFFU63cmhyGGbSdgrzHSXR6WQkd/O9RFnH0jH u9F3ZtWmeo3fLFBl4dBpFGa6Ie0iPRU= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-483-4uWy1gNXOgmj30_I9fONrg-1; Mon, 06 Jan 2025 11:33:16 -0500 X-MC-Unique: 4uWy1gNXOgmj30_I9fONrg-1 X-Mimecast-MFC-AGG-ID: 4uWy1gNXOgmj30_I9fONrg Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-467be89d064so189753851cf.3 for ; Mon, 06 Jan 2025 08:33:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736181195; x=1736785995; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nj05/m24/4BxJWa6etxk/u4r0K2E2F4f8k5SgnFKd7M=; b=AY8CV2nzyMZyNQudu5TPjYmlCkNXCg3MqTNQC7rhUQJPC+XwZKbMhR89OCyrRzT6IT 6w7EICW3KhNzQ+GffT/TUY3jtBkV18hmwYW9qRxqu9cRyFDwF86gGtCdPBtextQLFsr9 XVv7n8DFdZn/UIEoBWSeckqcSTwUgOYAlU2U2WkahXIPWfWZ3Uhlhs13IzAzEoZVSeVf xFrPlA+4jN6qmTFH2RpFUmiUdDddjo7Iy3xwxZH/Gue9VZTVaUXwyTBc6WYJqW84aM+j k9lfb3oVaNalU9KizOtn1dtdLLbxnvtjRagJQRVcYoI/XQxcmUphIpCslrfvYPglOPfH djRA== X-Gm-Message-State: AOJu0YwOSubys8ZLEwlV7X/q5AG+sxGDs4+aa9w/Xw52+kdp1hnDn48l EvVZX0LrBGFuhGzmShtYPliZzvunm2Kp/CkkRuHQDpc1ilpWGk8Htf6gG4qveobCgOOsNIZJ8RX cyIEiSeszOFoiV9l0BUyNNQSnDsQRKYkk3wrs9YL/CSEHxWPMYQHgYoi0V26I9VEeUPFMV8bUad fTPLPdq9rOcP9MNB06kVNGxANZnD/WwwlY+Cnb9g== X-Gm-Gg: ASbGncve8XVsqddoVqBgVZ+4d2tlUOqdD2kvkO5sBZ1KhgmgnUcgoqOlmhmqvGx56Ku kbSUaQ2il6mfXjGySDt/NsTA/mc03X2EU7/2ESgrSYk54eP94Rg6czWKAYVffjTN1N2LZ26igxd Zv4hTdBFEaw2r1YpTZ/fLqMETINuUGahw+DfCON5mM/3xeBvoM+Jbt01tpnDUtxUlHv+XvNh0tM geFEDH4aP8xw4AzSsPdU/Pt/5JTPSLcQ8rI5KXsnGGzwvhKS4Q7u0xUPGAMQIAp2M5U9GTJnbHv TiSEWBoYJQb6FWadM62lz/Br X-Received: by 2002:a05:622a:650:b0:467:7eb6:a007 with SMTP id d75a77b69052e-46a4a98a27bmr863243611cf.37.1736181195259; Mon, 06 Jan 2025 08:33:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGYUmYkQsOcHrmgsQ2+mgipWNob19X/QtCqjDpfH6OefXeBBEhKmLG1uJs7WGppIa3VpOrElQ== X-Received: by 2002:a05:622a:650:b0:467:7eb6:a007 with SMTP id d75a77b69052e-46a4a98a27bmr863243281cf.37.1736181194891; Mon, 06 Jan 2025 08:33:14 -0800 (PST) Received: from x1carbon9g.redhat.com (ip-94-112-226-240.bb.vodafone.cz. [94.112.226.240]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-46a3e67e361sm176664841cf.31.2025.01.06.08.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 08:33:14 -0800 (PST) From: Arjun Shankar To: libc-alpha@sourceware.org Cc: Arjun Shankar Subject: [PATCH v2 5/5] manual: Document futimens and utimensat Date: Mon, 6 Jan 2025 17:26:10 +0100 Message-ID: <20250106163257.705106-6-arjun@redhat.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250106163257.705106-1-arjun@redhat.com> References: <20250106163257.705106-1-arjun@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: PkSLAyeatR5PviV3JqNCEWXFpv92B9IGH42hNMFfU18_1736181196 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org --- manual/filesys.texi | 69 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/manual/filesys.texi b/manual/filesys.texi index ba2f13ef96..a5a5e1a1b4 100644 --- a/manual/filesys.texi +++ b/manual/filesys.texi @@ -3273,6 +3273,74 @@ The file lives on a read-only file system. @end table @end deftypefun +@deftypefun int futimens (int @var{filedes}, const struct timespec @var{tsp}@t{[2]}) +@standards{POSIX.1-2008, sys/stat.h} +@comment Unaudited and therefore marked AC-Unsafe and AS-Unsafe by default +@safety{@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} +This function is like @code{futimes}, except that it sets the file access +and modification timestamps with nanosecond precision. The argument +@code{tsp} is used similarly to @code{futimes}' @code{tvp}, but has a +@code{struct timespec} type that can express calendar time with nanosecond +precision; see @ref{Time Types}. + +Compared to @code{futimes}, the following additional error conditions can +occur: + +@table @code +@item EFAULT +The @var{tsp} argument points to an invalid address. + +@item EINVAL +At least of the fields in the @code{tsp} array passed has an invalid value. + +@end table +@end deftypefun + +@deftypefun int utimensat (int @var{filedes}, const char *@var{filename}, const struct timespec @var{tsp}@t{[2]}, int @var{flags}) +@standards{POSIX.1-2008, sys/stat.h} +@comment Unaudited and therefore marked AC-Unsafe and AS-Unsafe by default +@safety{@mtsafe{}@asunsafe{@asucorrupt{}}@acunsafe{@acucorrupt{}}} +This function is a descriptor-relative version of the @code{futimens} +function above. @xref{Descriptor-Relative Access}. The @var{flags} +argument can contain a combination of the flags @code{AT_EMPTY_PATH}, +and @code{AT_SYMLINK_NOFOLLOW}. + +Compared to @code{futimens}, the following additional error conditions can +occur: + +@table @code +@item EFAULT +The @var{filedes} argument is @code{AT_FDCWD} and @var{filename} is NULL or +points to an invalid address. + +@item EINVAL +The @var{flags} argument is not valid for this function. + +@item EINVAL +The @var{filename} argument is NULL, @var{filedes} is not @code{AT_FDCWD}, +and @var{flags} contains @code{AT_SYMLINK_NOFOLLOW}. + +@item ELOOP +There are too many levels of indirection. This can be the result of +circular symbolic links to directories. + +@item ENAMETOOLONG +The resulting path is too long. This error only occurs on systems which +have a limit on the file name length. + +@item ENOENT +The @var{filename} argument is an empty string or does not refer to an +existing file. + +@item ENOTDIR +The file descriptor @var{filedes} is not associated with a directory. + +@item ESRCH +Search permission was denied for one of the prefix components of the the +@var{filename} argument. +@end table +@end deftypefun + @node File Size @subsection File Size @@ -3889,5 +3957,4 @@ The @code{mkdtemp} function comes from OpenBSD. @c renameat2 @c scandirat @c symlinkat -@c utimensat @c mknodat