From patchwork Thu Aug 10 03:25:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 9892701 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 071D260236 for ; Thu, 10 Aug 2017 03:25:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 054A128AAC for ; Thu, 10 Aug 2017 03:25:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE48F28AB2; Thu, 10 Aug 2017 03:25:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D693E28AAC for ; Thu, 10 Aug 2017 03:25:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752231AbdHJDZe (ORCPT ); Wed, 9 Aug 2017 23:25:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:60562 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752197AbdHJDZd (ORCPT ); Wed, 9 Aug 2017 23:25:33 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 47A61AD6A; Thu, 10 Aug 2017 03:25:32 +0000 (UTC) From: NeilBrown To: "Michael Kerrisk \(man-pages\)" Date: Thu, 10 Aug 2017 13:25:21 +1000 Cc: linux-man@vger.kernel.org, Lennart Poettering , linux-fsdevel@vger.kernel.org Subject: [PATCH man-pages] open.2: improve O_PATH documentation. Message-ID: <873790rtni.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - fstatfs is now permitted. - ioctl isn't, and is worth listing explicitly - O_PATH allows an automount point to be opened with triggering the mount. All tested Signed-off-by: NeilBrown --- man2/open.2 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/man2/open.2 b/man2/open.2 index e3b00939790c..38d532397b02 100644 --- a/man2/open.2 +++ b/man2/open.2 @@ -585,6 +585,7 @@ The file itself is not opened, and other file operations (e.g., .BR fchmod (2), .BR fchown (2), .BR fgetxattr (2), +.BR ioctl (2), .BR mmap (2)) fail with the error .BR EBADF . @@ -599,8 +600,11 @@ be performed on the resulting file descriptor: (since Linux 3.5); .\" commit 332a2e1244bd08b9e3ecd378028513396a004a24 .BR fstat (2) -(since Linux 3.6). +(since Linux 3.6); .\" fstat(): commit 55815f70147dcfa3ead5738fd56d3574e2e3c1c2 +.BR fstatfs (2) +(since Linux 3.12). +.\" fstatfs(): commit 9d05746e7b16d8565dddbe3200faa1e669d23bbf .IP * Duplicating the file descriptor .RB ( dup (2), @@ -666,6 +670,16 @@ argument in calls to and .BR readlinkat (2) with an empty pathname to have the calls operate on the symbolic link. + +If +.I pathname +refers to an automount point that has not yet been triggered, so no +other filesystem is mounted on it, then the call returns a file +descriptor referring to the automount directory without triggering a mount. +.BR fstatfs (2) +can then be used to determine if it is, in fact, an untriggered +automount point +.RB ( ".f_type == AUTOFS_SUPER_MAGIC" ). .TP .B O_SYNC Write operations on the file will complete according to the requirements of