# SOME DESCRIPTIVE TITLE # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2024-03-01 17:03+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: TH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "open_by_handle_at" msgstr "" #. type: TH #: archlinux fedora-40 fedora-rawhide mageia-cauldron #, no-wrap msgid "2023-10-31" msgstr "" #. type: TH #: archlinux fedora-40 fedora-rawhide mageia-cauldron #, no-wrap msgid "Linux man-pages 6.06" msgstr "" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "NAME" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "name_to_handle_at, open_by_handle_at - obtain handle for a pathname and open " "file via a handle" msgstr "" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "LIBRARY" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "Standard C library (I, I<-lc>)" msgstr "" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "SYNOPSIS" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "" "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n" "B<#include Efcntl.hE>\n" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "" "BIB<, const char *>IB<,>\n" "B< struct file_handle *>IB<,>\n" "B< int *>IB<, int >IB<);>\n" "BIB<, struct file_handle *>IB<,>\n" "B< int >IB<);>\n" msgstr "" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "DESCRIPTION" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B() and B() system calls split " "the functionality of B(2) into two parts: B() " "returns an opaque handle that corresponds to a specified file; " "B() opens the file corresponding to a handle returned by " "a previous call to B() and returns an open file " "descriptor." msgstr "" #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "name_to_handle_at()" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B() system call returns a file handle and a mount ID " "corresponding to the file specified by the I and I " "arguments. The file handle is returned via the argument I, which is " "a pointer to a structure of the following form:" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "" "struct file_handle {\n" " unsigned int handle_bytes; /* Size of f_handle [in, out] */\n" " int handle_type; /* Handle type [out] */\n" " unsigned char f_handle[0]; /* File identifier (sized by\n" " caller) [out] */\n" "};\n" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "It is the caller's responsibility to allocate the structure with a size " "large enough to hold the handle returned in I. Before the call, " "the I field should be initialized to contain the allocated " "size for I. (The constant B, defined in " "Ifcntl.hE>, specifies the maximum expected size for a file " "handle. It is not a guaranteed upper limit as future filesystems may " "require more space.) Upon successful return, the I field is " "updated to contain the number of bytes actually written to I." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The caller can discover the required size for the I structure " "by making a call in which Ihandle_bytes> is zero; in this case, " "the call fails with the error B and Ihandle_bytes> " "is set to indicate the required size; the caller can then use this " "information to allocate a structure of the correct size (see EXAMPLES " "below). Some care is needed here as B can also indicate that no " "file handle is available for this particular name in a filesystem which does " "normally support file-handle lookup. This case can be detected when the " "B error is returned without I being increased." msgstr "" #. type: Plain text #: archlinux fedora-40 fedora-rawhide mageia-cauldron msgid "" "Other than the use of the I field, the caller should treat the " "I structure as an opaque data type: the I and " "I fields can be used in a subsequent call to " "B(). The caller can also use the opaque I " "to compare the identity of filesystem objects that were queried at different " "times and possibly at different paths. The B(7) subsystem can " "report events with an information record containing a I to " "identify the filesystem object." msgstr "" #. type: Plain text #: archlinux fedora-40 fedora-rawhide mageia-cauldron msgid "" "The I argument is a bit mask constructed by ORing together zero or " "more of B, B, and B, " "described below." msgstr "" #. commit 96b2b072ee62be8ae68c8ecf14854c4d0505a8f8 #. type: Plain text #: archlinux fedora-40 fedora-rawhide mageia-cauldron msgid "" "When I contain the B (since Linux 6.5) flag, the " "caller indicates that the returned I is needed to identify the " "filesystem object, and not for opening the file later, so it should be " "expected that a subsequent call to B() with the returned " "I may fail." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Together, the I and I arguments identify the file for which " "a handle is to be obtained. There are four distinct cases:" msgstr "" #. type: IP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "\\[bu]" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "If I is a nonempty string containing an absolute pathname, then a " "handle is returned for the file referred to by that pathname. In this case, " "I is ignored." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "If I is a nonempty string containing a relative pathname and " "I has the special value B, then I is interpreted " "relative to the current working directory of the caller, and a handle is " "returned for the file to which it refers." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "If I is a nonempty string containing a relative pathname and " "I is a file descriptor referring to a directory, then I is " "interpreted relative to the directory referred to by I, and a handle " "is returned for the file to which it refers. (See B(2) for an " "explanation of why \"directory file descriptors\" are useful.)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "If I is an empty string and I specifies the value " "B, then I can be an open file descriptor referring to " "any type of file, or B, meaning the current working directory, and " "a handle is returned for the file to which it refers." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The I argument returns an identifier for the filesystem mount that " "corresponds to I. This corresponds to the first field in one of " "the records in I. Opening the pathname in the fifth " "field of that record yields a file descriptor for the mount point; that file " "descriptor can be used in a subsequent call to B(). " "I is returned both for a successful call and for a call that " "results in the error B." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "By default, B() does not dereference I if it " "is a symbolic link, and thus returns a handle for the link itself. If " "B is specified in I, I is dereferenced " "if it is a symbolic link (so that the call returns a handle for the file " "referred to by the link)." msgstr "" #. commit 20fa19027286983ab2734b5910c4a687436e0c31 #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "B() does not trigger a mount when the final component of " "the pathname is an automount point. When a filesystem supports both file " "handles and automount points, a B() call on an automount " "point will return with error B without having increased " "I. This can happen since Linux 4.13 with NFS when accessing a " "directory which is on a separate filesystem on the server. In this case, " "the automount can be triggered by adding a \"/\" to the end of the pathname." msgstr "" #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "open_by_handle_at()" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B() system call opens the file referred to by " "I, a file handle returned by a previous call to " "B()." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The I argument is a file descriptor for any object (file, " "directory, etc.) in the mounted filesystem with respect to which I " "should be interpreted. The special value B can be specified, " "meaning the current working directory of the caller." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The I argument is as for B(2). If I refers to a " "symbolic link, the caller must specify the B flag, and the symbolic " "link is not dereferenced; the B flag, if specified, is ignored." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The caller must have the B capability to invoke " "B()." msgstr "" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "RETURN VALUE" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "On success, B() returns 0, and B() " "returns a file descriptor (a nonnegative integer)." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "In the event of an error, both system calls return -1 and set I to " "indicate the error." msgstr "" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "ERRORS" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "B() and B() can fail for the same " "errors as B(2). In addition, they can fail with the errors noted " "below." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "B() can fail with the following errors:" msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "I, I, or I points outside your accessible " "address space." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "I includes an invalid bit value." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "Ihandle_bytes> is greater than B." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "I is an empty string, but B was not specified in " "I." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The file descriptor supplied in I does not refer to a directory, and " "it is not the case that both I includes B and " "I is an empty string." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The filesystem does not support decoding of a pathname to a file handle." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The Ihandle_bytes> value passed into the call was too small. " "When this error occurs, Ihandle_bytes> is updated to indicate " "the required size for the handle." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "B() can fail with the following errors:" msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "I is not an open file descriptor." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "I is relative but I is neither B nor a valid file " "descriptor." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "I points outside your accessible address space." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Ihandle_bytes> is greater than B or is equal to " "zero." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "I refers to a symbolic link, but B was not specified in " "I." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "The caller does not have the B capability." msgstr "" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "" #. type: Plain text #: archlinux fedora-40 fedora-rawhide mageia-cauldron msgid "" "The specified I is not valid for opening a file. This error will " "occur if, for example, the file has been deleted. This error can also occur " "if the I was acquired using the B flag and the " "filesystem does not support B()." msgstr "" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "VERSIONS" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "FreeBSD has a broadly similar pair of system calls in the form of " "B() and B()." msgstr "" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "STANDARDS" msgstr "" #. type: Plain text #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-leap-15-6 opensuse-tumbleweed msgid "Linux." msgstr "" #. type: SH #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "HISTORY" msgstr "" #. type: Plain text #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-leap-15-6 opensuse-tumbleweed msgid "Linux 2.6.39, glibc 2.14." msgstr "" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "NOTES" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "A file handle can be generated in one process using B() " "and later used in a different process that calls B()." msgstr "" #. type: Plain text #: archlinux fedora-40 fedora-rawhide mageia-cauldron msgid "" "Some filesystem don't support the translation of pathnames to file handles, " "for example, I, I, and various network filesystems. Some " "filesystems support the translation of pathnames to file handles, but do not " "support using those file handles in B()." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "A file handle may become invalid (\"stale\") if a file is deleted, or for " "other filesystem-specific reasons. Invalid handles are notified by an " "B error from B()." msgstr "" #. https://lwn.net/Articles/375888/ #. "Open by handle" - Jonathan Corbet, 2010-02-23 #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "These system calls are designed for use by user-space file servers. For " "example, a user-space NFS server might generate a file handle and pass it to " "an NFS client. Later, when the client wants to open the file, it could pass " "the handle back to the server. This sort of functionality allows a user-" "space file server to operate in a stateless fashion with respect to the " "files it serves." msgstr "" #. commit bcda76524cd1fa32af748536f27f674a13e56700 #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "If I refers to a symbolic link and I does not specify " "B, then B() returns a handle for the " "link (rather than the file to which it refers). The process receiving the " "handle can later perform operations on the symbolic link by converting the " "handle to a file descriptor using B() with the B " "flag, and then passing the file descriptor as the I argument in " "system calls such as B(2) and B(2)." msgstr "" #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Obtaining a persistent filesystem ID" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The mount IDs in I can be reused as filesystems are " "unmounted and mounted. Therefore, the mount ID returned by " "B() (in I<*mount_id>) should not be treated as a " "persistent identifier for the corresponding mounted filesystem. However, an " "application can use the information in the I record that " "corresponds to the mount ID to derive a persistent identifier." msgstr "" #. e.g., http://stackoverflow.com/questions/6748429/using-libblkid-to-find-uuid-of-a-partition #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "For example, one can use the device name in the fifth field of the " "I record to search for the corresponding device UUID via the " "symbolic links in I. (A more comfortable way of " "obtaining the UUID is to use the B(3) library.) That process can " "then be reversed, using the UUID to look up the device name, and then " "obtaining the corresponding mount point, in order to produce the I " "argument used by B()." msgstr "" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "EXAMPLES" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The two programs below demonstrate the use of B() and " "B(). The first program (I) uses " "B() to obtain the file handle and mount ID for the file " "specified in its command-line argument; the handle and mount ID are written " "to standard output." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The second program (I) reads a mount ID and file " "handle from standard input. The program then employs " "B() to open the file using that handle. If an optional " "command-line argument is supplied, then the I argument for " "B() is obtained by opening the directory named in that " "argument. Otherwise, I is obtained by scanning I to find a record whose mount ID matches the mount ID read from " "standard input, and the mount directory specified in that record is opened. " "(These programs do not deal with the fact that mount IDs are not persistent.)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "The following shell session demonstrates the use of these two programs:" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "" "$ B cecilia.txt>\n" "$ B<./t_name_to_handle_at cecilia.txt E fh>\n" "$ B<./t_open_by_handle_at E fh>\n" "open_by_handle_at: Operation not permitted\n" "$ B fh> # Need CAP_SYS_ADMIN\n" "Read 31 bytes\n" "$ B\n" msgstr "" #. Christoph Hellwig: That's why the file handles contain a generation #. counter that gets incremented in this case. #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Now we delete and (quickly) re-create the file so that it has the same " "content and (by chance) the same inode. Nevertheless, " "B() recognizes that the original file referred to by the " "file handle no longer exists." msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "" "$ B # Display inode number\n" "4072121\n" "$ B\n" "$ B cecilia.txt>\n" "$ B # Check inode number\n" "4072121\n" "$ B fh>\n" "open_by_handle_at: Stale NFS file handle\n" msgstr "" #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Program source: t_name_to_handle_at.c" msgstr "" #. type: Plain text #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-tumbleweed #, no-wrap msgid "" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Eerrno.hE\n" "#include Efcntl.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " int mount_id, fhsize, flags, dirfd;\n" " char *pathname;\n" " struct file_handle *fhp;\n" "\\&\n" " if (argc != 2) {\n" " fprintf(stderr, \"Usage: %s pathname\\en\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " pathname = argv[1];\n" "\\&\n" " /* Allocate file_handle structure. */\n" "\\&\n" " fhsize = sizeof(*fhp);\n" " fhp = malloc(fhsize);\n" " if (fhp == NULL)\n" " err(EXIT_FAILURE, \"malloc\");\n" "\\&\n" " /* Make an initial call to name_to_handle_at() to discover\n" " the size required for file handle. */\n" "\\&\n" " dirfd = AT_FDCWD; /* For name_to_handle_at() calls */\n" " flags = 0; /* For name_to_handle_at() calls */\n" " fhp-Ehandle_bytes = 0;\n" " if (name_to_handle_at(dirfd, pathname, fhp,\n" " &mount_id, flags) != -1\n" " || errno != EOVERFLOW)\n" " {\n" " fprintf(stderr, \"Unexpected result from name_to_handle_at()\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Reallocate file_handle structure with correct size. */\n" "\\&\n" " fhsize = sizeof(*fhp) + fhp-Ehandle_bytes;\n" " fhp = realloc(fhp, fhsize); /* Copies fhp-Ehandle_bytes */\n" " if (fhp == NULL)\n" " err(EXIT_FAILURE, \"realloc\");\n" "\\&\n" " /* Get file handle from pathname supplied on command line. */\n" "\\&\n" " if (name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags) == -1)\n" " err(EXIT_FAILURE, \"name_to_handle_at\");\n" "\\&\n" " /* Write mount ID, file handle size, and file handle to stdout,\n" " for later reuse by t_open_by_handle_at.c. */\n" "\\&\n" " printf(\"%d\\en\", mount_id);\n" " printf(\"%u %d \", fhp-Ehandle_bytes, fhp-Ehandle_type);\n" " for (size_t j = 0; j E fhp-Ehandle_bytes; j++)\n" " printf(\" %02x\", fhp-Ef_handle[j]);\n" " printf(\"\\en\");\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" #. SRC END #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Program source: t_open_by_handle_at.c" msgstr "" #. type: Plain text #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-tumbleweed #, no-wrap msgid "" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Efcntl.hE\n" "#include Elimits.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Eunistd.hE\n" "\\&\n" "/* Scan /proc/self/mountinfo to find the line whose mount ID matches\n" " \\[aq]mount_id\\[aq]. (An easier way to do this is to install and use the\n" " \\[aq]libmount\\[aq] library provided by the \\[aq]util-linux\\[aq] project.)\n" " Open the corresponding mount path and return the resulting file\n" " descriptor. */\n" "\\&\n" "static int\n" "open_mount_path_by_id(int mount_id)\n" "{\n" " int mi_mount_id, found;\n" " char mount_path[PATH_MAX];\n" " char *linep;\n" " FILE *fp;\n" " size_t lsize;\n" " ssize_t nread;\n" "\\&\n" " fp = fopen(\"/proc/self/mountinfo\", \"r\");\n" " if (fp == NULL)\n" " err(EXIT_FAILURE, \"fopen\");\n" "\\&\n" " found = 0;\n" " linep = NULL;\n" " while (!found) {\n" " nread = getline(&linep, &lsize, fp);\n" " if (nread == -1)\n" " break;\n" "\\&\n" " nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n" " &mi_mount_id, mount_path);\n" " if (nread != 2) {\n" " fprintf(stderr, \"Bad sscanf()\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " if (mi_mount_id == mount_id)\n" " found = 1;\n" " }\n" " free(linep);\n" "\\&\n" " fclose(fp);\n" "\\&\n" " if (!found) {\n" " fprintf(stderr, \"Could not find mount point\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " return open(mount_path, O_RDONLY);\n" "}\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " int mount_id, fd, mount_fd, handle_bytes;\n" " char buf[1000];\n" "#define LINE_SIZE 100\n" " char line1[LINE_SIZE], line2[LINE_SIZE];\n" " char *nextp;\n" " ssize_t nread;\n" " struct file_handle *fhp;\n" "\\&\n" " if ((argc E 1 && strcmp(argv[1], \"--help\") == 0) || argc E 2) {\n" " fprintf(stderr, \"Usage: %s [mount-path]\\en\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Standard input contains mount ID and file handle information:\n" "\\&\n" " Line 1: Emount_idE\n" " Line 2: Ehandle_bytesE Ehandle_typeE Ebytes of handle in hexE\n" " */\n" "\\&\n" " if (fgets(line1, sizeof(line1), stdin) == NULL ||\n" " fgets(line2, sizeof(line2), stdin) == NULL)\n" " {\n" " fprintf(stderr, \"Missing mount_id / file handle\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " mount_id = atoi(line1);\n" "\\&\n" " handle_bytes = strtoul(line2, &nextp, 0);\n" "\\&\n" " /* Given handle_bytes, we can now allocate file_handle structure. */\n" "\\&\n" " fhp = malloc(sizeof(*fhp) + handle_bytes);\n" " if (fhp == NULL)\n" " err(EXIT_FAILURE, \"malloc\");\n" "\\&\n" " fhp-Ehandle_bytes = handle_bytes;\n" "\\&\n" " fhp-Ehandle_type = strtoul(nextp, &nextp, 0);\n" "\\&\n" " for (size_t j = 0; j E fhp-Ehandle_bytes; j++)\n" " fhp-Ef_handle[j] = strtoul(nextp, &nextp, 16);\n" "\\&\n" " /* Obtain file descriptor for mount point, either by opening\n" " the pathname specified on the command line, or by scanning\n" " /proc/self/mounts to find a mount that matches the \\[aq]mount_id\\[aq]\n" " that we received from stdin. */\n" "\\&\n" " if (argc E 1)\n" " mount_fd = open(argv[1], O_RDONLY);\n" " else\n" " mount_fd = open_mount_path_by_id(mount_id);\n" "\\&\n" " if (mount_fd == -1)\n" " err(EXIT_FAILURE, \"opening mount fd\");\n" "\\&\n" " /* Open file using handle and mount point. */\n" "\\&\n" " fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n" " if (fd == -1)\n" " err(EXIT_FAILURE, \"open_by_handle_at\");\n" "\\&\n" " /* Try reading a few bytes from the file. */\n" "\\&\n" " nread = read(fd, buf, sizeof(buf));\n" " if (nread == -1)\n" " err(EXIT_FAILURE, \"read\");\n" "\\&\n" " printf(\"Read %zd bytes\\en\", nread);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" #. SRC END #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "SEE ALSO" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "B(2), B(3), B(8), B(8), B(8)" msgstr "" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The I and I documentation in the latest I " "release at E<.UR https://www.kernel.org/pub/linux/utils/util-linux/> E<.UE>" msgstr "" #. type: TH #: debian-bookworm #, no-wrap msgid "2023-02-05" msgstr "" #. type: TH #: debian-bookworm #, no-wrap msgid "Linux man-pages 6.03" msgstr "" #. type: Plain text #: debian-bookworm debian-unstable opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Other than the use of the I field, the caller should treat the " "I structure as an opaque data type: the I and " "I fields are needed only by a subsequent call to " "B()." msgstr "" #. type: Plain text #: debian-bookworm debian-unstable opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The I argument is a bit mask constructed by ORing together zero or " "more of B and B, described below." msgstr "" #. type: Plain text #: debian-bookworm debian-unstable opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The specified I is not valid. This error will occur if, for " "example, the file has been deleted." msgstr "" #. type: Plain text #: debian-bookworm msgid "" "These system calls first appeared in Linux 2.6.39. Library support is " "provided since glibc 2.14." msgstr "" #. type: Plain text #: debian-bookworm msgid "These system calls are nonstandard Linux extensions." msgstr "" #. type: Plain text #: debian-bookworm debian-unstable opensuse-leap-15-6 opensuse-tumbleweed msgid "" "Some filesystem don't support the translation of pathnames to file handles, " "for example, I, I, and various network filesystems." msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Eerrno.hE\n" "#include Efcntl.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "int\n" "main(int argc, char *argv[])\n" "{\n" " int mount_id, fhsize, flags, dirfd;\n" " char *pathname;\n" " struct file_handle *fhp;\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " if (argc != 2) {\n" " fprintf(stderr, \"Usage: %s pathname\\en\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " pathname = argv[1];\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Allocate file_handle structure. */\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " fhsize = sizeof(*fhp);\n" " fhp = malloc(fhsize);\n" " if (fhp == NULL)\n" " err(EXIT_FAILURE, \"malloc\");\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " /* Make an initial call to name_to_handle_at() to discover\n" " the size required for file handle. */\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " dirfd = AT_FDCWD; /* For name_to_handle_at() calls */\n" " flags = 0; /* For name_to_handle_at() calls */\n" " fhp-Ehandle_bytes = 0;\n" " if (name_to_handle_at(dirfd, pathname, fhp,\n" " &mount_id, flags) != -1\n" " || errno != EOVERFLOW)\n" " {\n" " fprintf(stderr, \"Unexpected result from name_to_handle_at()\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Reallocate file_handle structure with correct size. */\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " fhsize = sizeof(*fhp) + fhp-Ehandle_bytes;\n" " fhp = realloc(fhp, fhsize); /* Copies fhp-Ehandle_bytes */\n" " if (fhp == NULL)\n" " err(EXIT_FAILURE, \"realloc\");\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Get file handle from pathname supplied on command line. */\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " if (name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags) == -1)\n" " err(EXIT_FAILURE, \"name_to_handle_at\");\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " /* Write mount ID, file handle size, and file handle to stdout,\n" " for later reuse by t_open_by_handle_at.c. */\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " printf(\"%d\\en\", mount_id);\n" " printf(\"%u %d \", fhp-Ehandle_bytes, fhp-Ehandle_type);\n" " for (size_t j = 0; j E fhp-Ehandle_bytes; j++)\n" " printf(\" %02x\", fhp-Ef_handle[j]);\n" " printf(\"\\en\");\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Efcntl.hE\n" "#include Elimits.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" "#include Eunistd.hE\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "/* Scan /proc/self/mountinfo to find the line whose mount ID matches\n" " \\[aq]mount_id\\[aq]. (An easier way to do this is to install and use the\n" " \\[aq]libmount\\[aq] library provided by the \\[aq]util-linux\\[aq] project.)\n" " Open the corresponding mount path and return the resulting file\n" " descriptor. */\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "static int\n" "open_mount_path_by_id(int mount_id)\n" "{\n" " int mi_mount_id, found;\n" " char mount_path[PATH_MAX];\n" " char *linep;\n" " FILE *fp;\n" " size_t lsize;\n" " ssize_t nread;\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " fp = fopen(\"/proc/self/mountinfo\", \"r\");\n" " if (fp == NULL)\n" " err(EXIT_FAILURE, \"fopen\");\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " found = 0;\n" " linep = NULL;\n" " while (!found) {\n" " nread = getline(&linep, &lsize, fp);\n" " if (nread == -1)\n" " break;\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n" " &mi_mount_id, mount_path);\n" " if (nread != 2) {\n" " fprintf(stderr, \"Bad sscanf()\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " if (mi_mount_id == mount_id)\n" " found = 1;\n" " }\n" " free(linep);\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " fclose(fp);\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " if (!found) {\n" " fprintf(stderr, \"Could not find mount point\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " return open(mount_path, O_RDONLY);\n" "}\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "int\n" "main(int argc, char *argv[])\n" "{\n" " int mount_id, fd, mount_fd, handle_bytes;\n" " char buf[1000];\n" "#define LINE_SIZE 100\n" " char line1[LINE_SIZE], line2[LINE_SIZE];\n" " char *nextp;\n" " ssize_t nread;\n" " struct file_handle *fhp;\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " if ((argc E 1 && strcmp(argv[1], \"--help\") == 0) || argc E 2) {\n" " fprintf(stderr, \"Usage: %s [mount-path]\\en\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Standard input contains mount ID and file handle information:\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " Line 1: Emount_idE\n" " Line 2: Ehandle_bytesE Ehandle_typeE Ebytes of handle in hexE\n" " */\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " if (fgets(line1, sizeof(line1), stdin) == NULL ||\n" " fgets(line2, sizeof(line2), stdin) == NULL)\n" " {\n" " fprintf(stderr, \"Missing mount_id / file handle\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " mount_id = atoi(line1);\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " handle_bytes = strtoul(line2, &nextp, 0);\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Given handle_bytes, we can now allocate file_handle structure. */\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " fhp = malloc(sizeof(*fhp) + handle_bytes);\n" " if (fhp == NULL)\n" " err(EXIT_FAILURE, \"malloc\");\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " fhp-Ehandle_bytes = handle_bytes;\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " fhp-Ehandle_type = strtoul(nextp, &nextp, 0);\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " for (size_t j = 0; j E fhp-Ehandle_bytes; j++)\n" " fhp-Ef_handle[j] = strtoul(nextp, &nextp, 16);\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " /* Obtain file descriptor for mount point, either by opening\n" " the pathname specified on the command line, or by scanning\n" " /proc/self/mounts to find a mount that matches the \\[aq]mount_id\\[aq]\n" " that we received from stdin. */\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " if (argc E 1)\n" " mount_fd = open(argv[1], O_RDONLY);\n" " else\n" " mount_fd = open_mount_path_by_id(mount_id);\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " if (mount_fd == -1)\n" " err(EXIT_FAILURE, \"opening mount fd\");\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Open file using handle and mount point. */\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n" " if (fd == -1)\n" " err(EXIT_FAILURE, \"open_by_handle_at\");\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Try reading a few bytes from the file. */\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " nread = read(fd, buf, sizeof(buf));\n" " if (nread == -1)\n" " err(EXIT_FAILURE, \"read\");\n" msgstr "" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " printf(\"Read %zd bytes\\en\", nread);\n" msgstr "" #. type: TH #: debian-unstable opensuse-tumbleweed #, no-wrap msgid "2023-05-03" msgstr "" #. type: TH #: debian-unstable opensuse-tumbleweed #, no-wrap msgid "Linux man-pages 6.05.01" msgstr "" #. type: TH #: opensuse-leap-15-6 #, no-wrap msgid "2023-03-30" msgstr "" #. type: TH #: opensuse-leap-15-6 #, no-wrap msgid "Linux man-pages 6.04" msgstr ""