# French translation of manpages # This file is distributed under the same license as the manpages-l10n package. # Copyright © of this file: # Christophe Blaess , 1996-2003. # Stéphan Rafin , 2002. # Thierry Vignaud , 1999, 2002. # François Micaux, 2002. # Alain Portal , 2003-2008. # Jean-Philippe Guérard , 2005-2006. # Jean-Luc Coulon (f5ibh) , 2006-2007. # Julien Cristau , 2006-2007. # Thomas Huriaux , 2006-2008. # Nicolas François , 2006-2008. # Florentin Duneau , 2006-2010. # Simon Paillard , 2006. # Denis Barbier , 2006, 2010. # David Prévot , 2010-2014. # Frédéric Hantrais , 2013, 2014. # Jean-Philippe MENGUAL , 2020. msgid "" msgstr "" "Project-Id-Version: manpages-l10n 4.21.0\n" "POT-Creation-Date: 2026-06-05 06:33+0200\n" "PO-Revision-Date: 2024-03-13 18:20+0100\n" "Last-Translator: Jean-Philippe MENGUAL \n" "Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Generator: Lokalize 22.12.3\n" #. type: TH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "open_by_handle_at" msgstr "open_by_handle_at" #. type: TH #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "2026-02-22" msgstr "22 février 2026" #. type: TH #: archlinux debian-unstable #, no-wrap msgid "Linux man-pages 6.18" msgstr "Pages du manuel de Linux 6.18" #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "NAME" msgstr "NOM" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "name_to_handle_at, open_by_handle_at - obtain handle for a pathname and open " "file via a handle" msgstr "" "name_to_handle_at, open_by_handle_at - Récupérer le gestionnaire d'un chemin " "et ouvrir le fichier au moyen d'un gestionnaire" #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "LIBRARY" msgstr "BIBLIOTHÈQUE" #. type: Plain text #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "Standard C library (I,\\ I<-lc>)" msgstr "Bibliothèque C standard (I,\\ I<-lc>)" #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "SYNOPSIS" msgstr "SYNOPSIS" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n" "B<#include Efcntl.hE>\n" msgstr "" "B<#define _GNU_SOURCE> /* Consultez feature_test_macros(7) */\n" "B<#include Efcntl.hE>\n" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy, 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" 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 "" "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" #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "DESCRIPTION" msgstr "DESCRIPTION" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "Les appels système B() et B() scindent " "la fonction de B(2) en deux parties : B() renvoie " "un gestionnaire opaque qui correspond à un fichier indiqué ; " "B() ouvre le fichier correspondant à un gestionnaire " "renvoyé par un appel antérieur à B() et renvoie le " "descripteur d'un fichier ouvert." #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "name_to_handle_at()" msgstr "name_to_handle_at()" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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:" 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 "" "L'appel système B() renvoie un gestionnaire de fichier et " "un identifiant de montage (« mount ID ») correspondant au fichier désigné " "par les arguments I et I. Le gestionnaire de fichier est " "renvoyé au moyen de l'argument I. Cet argument est un pointeur vers " "une structure qui présente la forme suivante :" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "struct file_handle {\n" " unsigned int handle_bytes; /* taille de f_handle [in, out] */\n" " int handle_type; /* type du gestionnaire [out] */\n" " unsigned char f_handle[0]; /* identifiant du fichier (taille\n" " définie par l’appelant) [out] */\n" "};\n" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "L'appelant à l'origine de l'appel doit s'assurer que la structure est créée " "avec une taille suffisante pour contenir le gestionnaire renvoyé dans " "I. Avant l'appel, le champ I devrait être initialisé " "de sorte que l'espace alloué puisse recevoir I. (La constante " "B, définie dans Ifcntl.hE>, précise la taille " "maximale autorisée pour un gestionnaire de fichier. La limite supérieure " "n'est pas garantie car de futurs systèmes de fichiers pourraient avoir " "besoin de davantage d'espace). Lorsque l'appel réussit, le champ " "I est mis à jour afin de contenir le nombre d'octets " "effectivement écrits dans I." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "L'appelant peut prendre connaissance de l'espace nécessaire à la structure " "I en effectuant un appel dans lequel Ihandle_bytes> vaut zéro ; dans ce cas, l'appel échoue en renvoyant " "l'erreur B et Ihandle_bytes> prend pour valeur la " "taille requise ; l'appelant peut alors utiliser cette information pour " "allouer une structure ayant la taille convenable (consultez EXEMPLES ci-" "dessous). Il faut faire attention ici car B peut indiquer " "qu'aucun gestionnaire de fichier n'est disponible pour ce nom particulier " "dans un système de fichiers qui prend normalement en charge la recherche de " "gestionnaire de fichiers. Ce cas peut se détecter quand l'erreur " "B est renvoyée sans que I ne soit augmenté." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 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 debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "The I argument is a bit mask constructed by ORing together zero or " #| "more of B, B, and B, " #| "described below." msgid "" "The I argument is a bit mask constructed by ORing together zero or " "more of B, B, " "B, B, and B, " "described below." msgstr "" "L'argument I est un masque de bits construit par I binaire entre " "zéro ou plus de B et B, décrits plus bas." #. commit 96b2b072ee62be8ae68c8ecf14854c4d0505a8f8 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed 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 "" #. commit 4356d575ef0f39a3e8e0ce0c40d84ce900ac3b61 #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "When I contain the B (since Linux 6.12) " "flag, the caller indicates that the width of the I buffer is at " "least 64 bits, and then the mount id returned in that buffer is the unique " "mount id as the one returned by B(2) with the B " "flag." msgstr "" #. commit a20853ab8296d4a8754482cb5e9adde8ab426a25 #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "When I contain the B (since Linux 6.13) flag, " "the caller indicates that the returned I is needed to open a " "file with known path later, so it should be expected that a subsequent call " "to B() with the returned I may fail if the " "file was moved, but otherwise, the path of the opened file is expected to be " "visible from the IpidI* magic link. This flag can not be used " "in combination with the flags B and/or B." msgstr "" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "Together, the I and I arguments identify the file for " #| "which a handle is to be obtained. There are four distinct cases:" msgid "" "Together, the I and I arguments identify the file for which a " "handle is to be obtained. There are four distinct cases:" msgstr "" "Ensemble, les arguments I et I désignent le fichier pour " "lequel on souhaite obtenir un gestionnaire. On distingue quatre cas : " #. type: IP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\[bu]" msgstr "-" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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." 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 "" "Si I est une chaîne non vide contenant un chemin d'accès absolu, " "alors un gestionnaire est renvoyé pour le fichier indiqué par ce chemin. " "Dans ce cas, I est ignoré." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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." 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 "" "Si I est une chaîne non vide contenant un chemin relatif, et si " "I a la valeur spéciale B, alors I est interprété " "par rapport au répertoire courant du processus appelant, et un gestionnaire " "est renvoyé pour le fichier indiqué par le chemin." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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.)" 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 "" "Si I est une chaîne non vide contenant un chemin d'accès relatif " "et si I est le descripteur de fichier d'un répertoire, alors " "I est interprété par rapport au répertoire désigné par I, " "et un gestionnaire est renvoyé pour le fichier indiqué par le chemin. " "(Consultez B(3) si vous souhaitez comprendre à quoi servent les " "« descripteurs de fichier de répertoires »)." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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." 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 "" "Si I est une chaîne vide, et si I précise la valeur de " "B, alors I peut être un descripteur de fichiers ouvert " "faisant référence à n'importe quel type de fichier ou à B " "(répertoire de travail courant), et un gestionnaire est renvoyé pour le " "fichier auquel il fait référence." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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." 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 "" "L'argument I renvoie un identifiant pour le point de montage du " "système de fichiers correspondant à I. Cet identifiant correspond " "au premier champ des entrées de I. L'ouverture du " "chemin indiqué dans le cinquième champ délivre un descripteur de fichier " "pour le point de montage ; ce descripteur de fichier peut être utilisé par " "la suite lors d'un appel à B(). I est renvoyé " "tant en cas de succès qu'en cas d'erreur B de l'appel." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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)." 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 "" "Par défaut, B() ne déréférence pas I s'il " "s'agit d'un lien symbolique, et donc renvoie un gestionnaire pour le lien " "lui-même. Si B est précisé dans I, I est " "déréférencé s'il s'agit d'un lien symbolique (de sorte que l'appel renvoie " "un indicateur pour le fichier vers lequel pointe le lien symbolique)." #. commit 20fa19027286983ab2734b5910c4a687436e0c31 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "B() ne récupère pas un montage quand le composant final " "du chemin est un point de montage automatique. Quand un système de fichiers " "gère à la fois les gestionnaires de fichier et les points de montage " "automatique, un appel B() sur un point de montage " "automatique renverra une erreur B sans augmenter I. " "Cela peut arriver depuis Linux 4.13 avec NFS lors d'un accès à un répertoire " "sur un système de fichiers séparé du serveur. Dans ce cas, le montage " "automatique peut être provoqué en ajoutant un « / » à la fin du chemin. " #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "open_by_handle_at()" msgstr "open_by_handle_at()" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "L'appel système B() ouvre le fichier auquel I " "fait référence, via un indicateur de fichier renvoyé lors d'un précédent " "appel à B()." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "L'argument I est un descripteur de fichier pour n'importe quel " "type d'objet (fichier, répertoire, etc.) du système de fichiers monté qui " "permet d'interpréter l'indicateur de fichier (I). La valeur spéciale " "B peut être précisée, et indique le répertoire courant du " "processus appelant. " #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "L'argument I a la même fonction que pour B(2). Si l'indicateur " "I fait référence à un lien symbolique, le processus appelant doit " "préciser l'attribut B et le lien symbolique n'est pas déréférencé. " "L'attribut B est ignoré." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The caller must have the B capability to invoke " "B()." msgstr "" "L'appelant doit avoir la capacité B pour utiliser " "B()." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "RETURN VALUE" msgstr "VALEUR RENVOYÉE" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "On success, B() returns 0, and B() " "returns a file descriptor (a nonnegative integer)." msgstr "" "Lorsqu'il réussit, l'appel B() renvoie B<0> et " "B() renvoie un descripteur de fichier (un entier non " "négatif)." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "In the event of an error, both system calls return -1 and set I to " "indicate the error." msgstr "" "En cas d'échec, les deux appels renvoient B<-1> et définissent I pour " "indiquer l'erreur." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "ERRORS" msgstr "ERREURS" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "Les appels B() et B() peuvent échouer " "pour les mêmes raisons que B(2). En outre, ils peuvent également " "échouer pour les motifs décrits plus bas. " #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "B() can fail with the following errors:" msgstr "B() peut échouer avec les erreurs suivantes :" #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "I, I, or I points outside your accessible " #| "address space." msgid "" "I, I, or I points outside your accessible address " "space." msgstr "" "I, I ou I pointe en dehors de l'espace " "d'adressage accessible." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "I includes an invalid bit value." msgid "I includes an invalid bit value or an invalid bit combination." msgstr "I comprend un bit incorrect." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Ihandle_bytes> is greater than B." msgstr "Ihandle_bytes> est supérieur à B." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| msgid "" #| "I is an empty string, but B was not specified in " #| "I." msgid "" "I is an empty string, but B was not specified in " "I." msgstr "" "I est une chaîne vide et B n’était pas indiqué dans " "I." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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." 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 "" "Le descripteur de fichiers fourni dans I ne fait pas référence à un " "répertoire, et il ne s'agit pas du cas où I comprend B " "et I est une chaîne vide." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The filesystem does not support decoding of a pathname to a file handle." msgstr "" "Le système de fichiers ne permet pas la transcription du chemin de fichier " "en indicateur de fichier." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "La valeur Ihandle_bytes> transmise dans l'appel est trop " "faible. Lorsque cette erreur se produit, Ihandle_bytes> est " "modifié afin d'indiquer la taille requise pour cet indicateur. " #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "B() can fail with the following errors:" msgstr "B() peut échouer avec les erreurs suivantes :" #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "I is not an open file descriptor." msgstr "I n'est pas un descripteur de fichier ouvert." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "I is relative but I is neither B nor a valid file " "descriptor." msgstr "" "I est relatif mais I n'est ni B ni un descripteur de " "fichier valable." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "I points outside your accessible address space." msgstr "I pointe en dehors de l'espace d'adressage accessible." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Ihandle_bytes> is greater than B or is equal to " "zero." msgstr "" "Ihandle_bytes> est supérieur à B ou égal à zéro." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "I refers to a symbolic link, but B was not specified in " "I." msgstr "" "I correspond à un lien symbolique et B n’était pas indiqué " "dans I." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The caller does not have the B capability." msgstr "L'appelant n'a pas la capacité B." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed 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(). This error can also " "occur if the I was acquired using the B flag " "and the file was moved to a different parent." msgstr "" #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "VERSIONS" msgstr "VERSIONS" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy #| msgid "" #| "FreeBSD has a broadly similar pair of system calls in the form of " #| "B() and B()." msgid "" "FreeBSD has a broadly similar pair of system calls in the form of " "B() and B()." msgstr "" "FreeBSD offre un couple d'appels système similaires : B() et " "B()." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "STANDARDS" msgstr "NORMES" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Linux." msgstr "Linux." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "HISTORY" msgstr "HISTORIQUE" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Linux 2.6.39, glibc 2.14." msgstr "Linux 2.6.39, glibc 2.14." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "NOTES" msgstr "NOTES" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "Un indicateur de fichier peut être créé dans un processus au moyen de " "B() et utilisé plus tard dans un autre processus qui " "appelle B()." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed 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 "" "Certains systèmes de fichiers ne permettent pas la transcription des chemins " "en indicateurs de fichier, par exemple, I, I, ainsi que divers " "systèmes de fichiers en réseaux. Certains systèmes de fichiers permettent la " "transcription des chemins en indicateurs de fichier, mais ne prennent pas en " "charge l'utilisation de ces indicateurs de fichier dans " "B()." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "Un indicateur de fichier peut devenir non valable (« stale ») si un fichier " "est supprimé, ou pour une raison propre au système de fichiers. Les " "indicateurs non autorisés sont signalés par une erreur B provenant " "de B(). " #. https://lwn.net/Articles/375888/ #. "Open by handle" - Jonathan Corbet, 2010-02-23 #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "Ces appels systèmes sont conçus pour être utilisés par des serveurs de " "fichiers en espace utilisateur. Par exemple, un serveur NFS en espace " "utilisateur produit un indicateur de fichier et le transmet au client NFS. " "Plus tard, lorsque le client souhaite accéder au fichier, il peut renvoyer " "l'indicateur au serveur. Ce type de fonctionnalité permet à un serveur de " "fichiers en espace utilisateur d'opérer sans état vis à vis des fichiers " "qu'il délivre." #. commit bcda76524cd1fa32af748536f27f674a13e56700 #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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)." 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 "" "Si I fait référence à un lien symbolique et si I ne précise " "pas B, alors B() renvoie un indicateur " "pour le lien (plutôt que pour le fichier vers lequel le lien pointe). Le " "processus recevant l'indicateur peut effectuer plus tard une opération sur " "ce lien symbolique, en convertissant l'indicateur en descripteur de fichier " "au moyen de B() utilisé avec l'argument B, et en " "passant le descripteur de fichier en argument I d’appels système " "(tels que B(2) et B(2)). " #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Obtaining a persistent filesystem ID" msgstr "Obtenir un identifiant persistant de système de fichier" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "Les identifiants de montage dans I peuvent être " "réutilisés même lorsque les systèmes de fichiers sont démontés et remontés. " "Ainsi, l'identifiant de montage renvoyé par B() (dans " "I<*mount_id>) ne doit pas être considéré comme un identifiant persistant " "pour le système de fichiers considéré. Néanmoins, il est possible pour une " "application d'utiliser l'information fournie dans I et " "correspondant à l'identifiant de montage pour en déduire un identifiant " "persistant." #. e.g., http://stackoverflow.com/questions/6748429/using-libblkid-to-find-uuid-of-a-partition #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "Par exemple, on peut utiliser le nom de périphérique présent dans le " "cinquième champ de I pour retrouver l'UUID du périphérique " "correspondant au moyen des liens symboliques dans I. (Un " "moyen plus simple d'obtenir cet UUID consiste à utiliser la bibliothèque " "B(3)). Cette façon de procéder peut être inversée, en utilisant " "l'UUID pour retrouver le nom du périphérique, et ainsi obtenir le point de " "montage correspondant, et enfin construire l'argument de I utile à " "B()." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "EXAMPLES" msgstr "EXEMPLES" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "Les deux programmes suivants illustrent l'utilisation de " "B() et de B(). Le premier programme " "(I) utilise B() pour récupérer " "l'indicateur de fichier et l'identifiant de montage du fichier indiqué dans " "les arguments en ligne de commande ; l'indicateur et l'identifiant de " "montage sont écrits sur la sortie standard." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "Le second programme (I) lit un identifiant de montage " "et un indicateur de fichier depuis l'entrée standard. Le programme utilise " "ensuite B() pour lire le fichier au moyen de cet " "indicateur. Si un argument optionnel est fourni dans la ligne de commande, " "alors l'argument I de B() est obtenu en ouvrant " "le répertoire précisé en argument. Sinon, I est obtenu en " "parcourant I à la recherche d'un identifiant de " "montage correspondant à celui fourni via l'entrée standard, et le répertoire " "monté qui a été trouvé est ouvert. (Ces programmes ne tiennent pas compte du " "fait que les identifiants de montage ne sont pas persistants.)" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The following shell session demonstrates the use of these two programs:" msgstr "" "La session shell suivante montre des exemples d'utilisation de ces deux " "programmes :" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy, 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" msgid "" "$B< echo \\[aq]Can you please think about it?\\[aq] E 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< sudo ./t_open_by_handle_at E fh>; # Need CAP_SYS_ADMIN\n" "Read 31 bytes\n" "$B< rm cecilia.txt>;\n" msgstr "" "$ 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> # Nécessite CAP_SYS_ADMIN\n" "Read 31 bytes\n" "$ B\n" #. Christoph Hellwig: That's why the file handles contain a generation #. counter that gets incremented in this case. #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 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 "" "A ce stade, on supprime et recrée (rapidement) le fichier, de sorte qu'il " "ait le même contenu et (avec un peu de chance) le même inœud. Cependant, " "B() s'aperçoit que le fichier original auquel " "l'indicateur fait référence n'existe plus." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy, 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" msgid "" "$B< stat --printf=\\[dq]%i\\[rs]n\\[dq] cecilia.txt>; # Display inode number\n" "4072121\n" "$B< rm cecilia.txt>;\n" "$B< echo \\[aq]Can you please think about it?\\[aq] E cecilia.txt>;\n" "$B< stat --printf=\\[dq]%i\\[rs]n\\[dq] cecilia.txt>; # Check inode number\n" "4072121\n" "$B< sudo ./t_open_by_handle_at E fh>;\n" "open_by_handle_at: Stale NFS file handle\n" msgstr "" "$ B # Affiche le numéro d'inœud\n" "4072121\n" "$ B\n" "$ B cecilia.txt>\n" "$ B # Vérifie le numéro d'inœud\n" "4072121\n" "$ B fh>\n" "open_by_handle_at: Stale NFS file handle\n" #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Program source: t_name_to_handle_at.c" msgstr "Source du programme : t_name_to_handle_at.c" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy, 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" 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 *path;\n" " struct file_handle *fhp;\n" "\\&\n" " if (argc != 2) {\n" " fprintf(stderr, \"Usage: %s path\\[rs]n\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " path = 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, path, fhp, &mount_id, flags) != -1\n" " || errno != EOVERFLOW)\n" " {\n" " fprintf(stderr, \"Unexpected result from name_to_handle_at()\\[rs]n\");\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, path, 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\\[rs]n\", 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(\"\\[rs]n\");\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" "#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, \"Utilisation : %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" " /* Effectue un appel initial à name_to_handle_at() afin de connaître\n" " la taille nécessaire à l'indicateur de fichier. */\n" "\\&\n" " dirfd = AT_FDCWD; /* Pour les appels à name_to_handle_at() */\n" " flags = 0; /* Pour les appels à name_to_handle_at() */\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, \"Résultat inattendu de name_to_handle_at()\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Ré-alloue la structure file_handle avec la bonne taille. */\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" " /* Retrouve l'indicateur de fichier à partir du\n" " chemin fourni dans la ligne de commande. */\n" "\\&\n" " if (name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags) == -1)\n" " err(EXIT_FAILURE, \"name_to_handle_at\");\n" "\\&\n" " /* Écrit l'identifiant de montage, la taille de l'indicateur et\n" " l'indicateur vers la sortie standard pour être utilisés\n" " plus tard par 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" #. SRC END #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Program source: t_open_by_handle_at.c" msgstr "Source du programme : t_open_by_handle_at.c" #. type: Plain text #: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed #, fuzzy, 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" 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 Esys/types.hE\n" "#include Eunistd.hE\n" "\\&\n" "#define streq(...) (strcmp(__VA_ARGS__) == 0)\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()\\[rs]n\");\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\\[rs]n\");\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 && streq(argv[1], \"--help\")) || argc E 2) {\n" " fprintf(stderr, \"Usage: %s [mount-path]\\[rs]n\", 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\\[rs]n\");\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\\[rs]n\", nread);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" "#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" "/* Parcourt /proc/self/mountinfo pour trouver la ligne correspondant à \n" " l'ID de montage \\[aq]mount_id\\[aq]. (Une méthode plus simple consiste à\n" " installer et à utiliser la bibliothèque (\\[aq]libmount\\[aq] fournie par\n" " le projet \\[aq]util-linux\\[aq].) Ouvre le point de montage correspondant\n" " et renvoie le descripteur de fichier associé. */\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, \"Mauvais 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, \"Point de montage non trouvé\\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, \"Utilisation : %s [mount-path]\\en\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* L'entrée standard contient l'identifiant de montage et\n" " les informations de l'indicateur :\n" "\\&\n" " Ligne 1 : Emount_idE\n" " Ligne 2 : Ehandle_bytesE Ehandle_typeE Eoctets du descripteur en hexadécimalE\n" "\\&\n" " if (fgets(line1, sizeof(line1), stdin) == NULL ||\n" " fgets(line2, sizeof(line2), stdin) == NULL)\n" " {\n" " fprintf(stderr, \"mount_id ou descripteur de fichier absent\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " mount_id = atoi(line1);\n" "\\&\n" " handle_bytes = strtoul(line2, &nextp, 0);\n" "\\&\n" " /* handle_bytes étant connu, on peut maintenant allouer la structure\n" " file_handle. */\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" " /* Récupère le descripteur de fichier du point de montage, soit en ouvrant\n" " le chemin indiqué dans la ligne de commande, soit en parcourant\n" " /proc/self/mounts pour retrouver un montage qui corresponde à\n" " \\[aq]mount_id\\[aq] qui a été reçu de 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" " /* Ouvre le fichier en utilisant l'indicateur et le point de montage. */\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" " /* On essaie de lire quelques octets depuis le fichier. */\n" "\\&\n" " nread = read(fd, buf, sizeof(buf));\n" " if (nread == -1)\n" " err(EXIT_FAILURE, \"read\");\n" "\\&\n" " printf(\"Lire %zd octets\\en\", nread);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" #. SRC END #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "SEE ALSO" msgstr "VOIR AUSSI" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "B(2), B(3), B(8), B(8), B(8)" msgstr "B(2), B(3), B(8), B(8), B(8)" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, fuzzy #| 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>" 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 "" "La documentation relative à I et à I de la dernière " "publication de I à E<.UR https://www.kernel.org/pub/linux/utils/" "util-linux/> E<.UE>" #. type: TH #: debian-trixie #, no-wrap msgid "2024-06-15" msgstr "15 juin 2024" #. type: TH #: debian-trixie #, no-wrap msgid "Linux man-pages 6.9.1" msgstr "Pages du manuel de Linux 6.9.1" #. type: Plain text #: debian-trixie msgid "Standard C library (I, I<-lc>)" msgstr "Bibliothèque C standard (I, I<-lc>)" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide #, 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 "" "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" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide 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 "" "L'appel système B() renvoie un gestionnaire de fichier et " "un identifiant de montage (« mount ID ») correspondant au fichier désigné " "par les arguments I et I. Le gestionnaire de fichier est " "renvoyé au moyen de l'argument I. Cet argument est un pointeur vers " "une structure qui présente la forme suivante :" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "The I argument is a bit mask constructed by ORing together zero or " "more of B, B, and B, " "described below." msgstr "" "L'argument I est un masque de bits construit par I binaire entre " "zéro ou plus de B et B, décrits plus bas." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "Together, the I and I arguments identify the file for which " "a handle is to be obtained. There are four distinct cases:" msgstr "" "Ensemble, les arguments I et I désignent le fichier pour " "lequel on souhaite obtenir un gestionnaire. On distingue quatre cas : " #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide 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 "" "Si I est une chaîne non vide contenant un chemin d'accès absolu, " "alors un gestionnaire est renvoyé pour le fichier indiqué par ce chemin. " "Dans ce cas, I est ignoré." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide 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 "" "Si I est une chaîne non vide contenant un chemin relatif, et si " "I a la valeur spéciale B, alors I est interprété " "par rapport au répertoire courant du processus appelant, et un gestionnaire " "est renvoyé pour le fichier indiqué par le chemin." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide 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 "" "Si I est une chaîne non vide contenant un chemin d'accès relatif " "et si I est le descripteur de fichier d'un répertoire, alors " "I est interprété par rapport au répertoire désigné par I, " "et un gestionnaire est renvoyé pour le fichier indiqué par le chemin. " "(Consultez B(3) si vous souhaitez comprendre à quoi servent les " "« descripteurs de fichier de répertoires »)." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide 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 "" "Si I est une chaîne vide, et si I précise la valeur de " "B, alors I peut être un descripteur de fichiers ouvert " "faisant référence à n'importe quel type de fichier ou à B " "(répertoire de travail courant), et un gestionnaire est renvoyé pour le " "fichier auquel il fait référence." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide 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 "" "L'argument I renvoie un identifiant pour le point de montage du " "système de fichiers correspondant à I. Cet identifiant correspond " "au premier champ des entrées de I. L'ouverture du " "chemin indiqué dans le cinquième champ délivre un descripteur de fichier " "pour le point de montage ; ce descripteur de fichier peut être utilisé par " "la suite lors d'un appel à B(). I est renvoyé " "tant en cas de succès qu'en cas d'erreur B de l'appel." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide 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 "" "Par défaut, B() ne déréférence pas I s'il " "s'agit d'un lien symbolique, et donc renvoie un gestionnaire pour le lien " "lui-même. Si B est précisé dans I, I est " "déréférencé s'il s'agit d'un lien symbolique (de sorte que l'appel renvoie " "un indicateur pour le fichier vers lequel pointe le lien symbolique)." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "I, I, or I points outside your accessible " "address space." msgstr "" "I, I ou I pointe en dehors de l'espace " "d'adressage accessible." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "I includes an invalid bit value." msgstr "I comprend un bit incorrect." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "I is an empty string, but B was not specified in " "I." msgstr "" "I est une chaîne vide et B n’était pas indiqué dans " "I." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide 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 "" "Le descripteur de fichiers fourni dans I ne fait pas référence à un " "répertoire, et il ne s'agit pas du cas où I comprend B " "et I est une chaîne vide." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "I is relative but I is neither B nor a valid file " "descriptor." msgstr "" "I est relatif mais I n'est ni B ni un descripteur " "de fichier valable." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide 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 "" #. commit bcda76524cd1fa32af748536f27f674a13e56700 #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide 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 "" "Si I fait référence à un lien symbolique et si I ne précise " "pas B, alors B() renvoie un indicateur " "pour le lien (plutôt que pour le fichier vers lequel le lien pointe). Le " "processus recevant l'indicateur peut effectuer plus tard une opération sur " "ce lien symbolique, en convertissant l'indicateur en descripteur de fichier " "au moyen de B() utilisé avec l'argument B, et en " "passant le descripteur de fichier en argument I d’appels système " "(tels que B(2) et B(2)). " #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide #, 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 "" "$ 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> # Nécessite CAP_SYS_ADMIN\n" "Read 31 bytes\n" "$ B\n" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide #, fuzzy, 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" 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 "" "$ B # Affiche le numéro d'inœud\n" "4072121\n" "$ B\n" "$ B cecilia.txt>\n" "$ B # Vérifie le numéro d'inœud\n" "4072121\n" "$ B fh>\n" "open_by_handle_at: Stale NFS file handle\n" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide #, fuzzy, 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" 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\\[rs]n\", 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()\\[rs]n\");\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\\[rs]n\", 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(\"\\[rs]n\");\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" "#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, \"Utilisation : %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" " /* Effectue un appel initial à name_to_handle_at() afin de connaître\n" " la taille nécessaire à l'indicateur de fichier. */\n" "\\&\n" " dirfd = AT_FDCWD; /* Pour les appels à name_to_handle_at() */\n" " flags = 0; /* Pour les appels à name_to_handle_at() */\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, \"Résultat inattendu de name_to_handle_at()\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* Ré-alloue la structure file_handle avec la bonne taille. */\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" " /* Retrouve l'indicateur de fichier à partir du\n" " chemin fourni dans la ligne de commande. */\n" "\\&\n" " if (name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags) == -1)\n" " err(EXIT_FAILURE, \"name_to_handle_at\");\n" "\\&\n" " /* Écrit l'identifiant de montage, la taille de l'indicateur et\n" " l'indicateur vers la sortie standard pour être utilisés\n" " plus tard par 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" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide #, fuzzy, 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" 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 Esys/types.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()\\[rs]n\");\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\\[rs]n\");\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]\\[rs]n\", 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\\[rs]n\");\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\\[rs]n\", nread);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" "#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" "/* Parcourt /proc/self/mountinfo pour trouver la ligne correspondant à \n" " l'ID de montage \\[aq]mount_id\\[aq]. (Une méthode plus simple consiste à\n" " installer et à utiliser la bibliothèque (\\[aq]libmount\\[aq] fournie par\n" " le projet \\[aq]util-linux\\[aq].) Ouvre le point de montage correspondant\n" " et renvoie le descripteur de fichier associé. */\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, \"Mauvais 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, \"Point de montage non trouvé\\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, \"Utilisation : %s [mount-path]\\en\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* L'entrée standard contient l'identifiant de montage et\n" " les informations de l'indicateur :\n" "\\&\n" " Ligne 1 : Emount_idE\n" " Ligne 2 : Ehandle_bytesE Ehandle_typeE Eoctets du descripteur en hexadécimalE\n" "\\&\n" " if (fgets(line1, sizeof(line1), stdin) == NULL ||\n" " fgets(line2, sizeof(line2), stdin) == NULL)\n" " {\n" " fprintf(stderr, \"mount_id ou descripteur de fichier absent\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " mount_id = atoi(line1);\n" "\\&\n" " handle_bytes = strtoul(line2, &nextp, 0);\n" "\\&\n" " /* handle_bytes étant connu, on peut maintenant allouer la structure\n" " file_handle. */\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" " /* Récupère le descripteur de fichier du point de montage, soit en ouvrant\n" " le chemin indiqué dans la ligne de commande, soit en parcourant\n" " /proc/self/mounts pour retrouver un montage qui corresponde à\n" " \\[aq]mount_id\\[aq] qui a été reçu de 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" " /* Ouvre le fichier en utilisant l'indicateur et le point de montage. */\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" " /* On essaie de lire quelques octets depuis le fichier. */\n" "\\&\n" " nread = read(fd, buf, sizeof(buf));\n" " if (nread == -1)\n" " err(EXIT_FAILURE, \"read\");\n" "\\&\n" " printf(\"Lire %zd octets\\en\", nread);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide 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 "" "La documentation relative à I et à I de la dernière " "publication de I à E<.UR https://www.kernel.org/pub/linux/utils/" "util-linux/> E<.UE>" #. type: TH #: fedora-44 fedora-rawhide #, no-wrap msgid "2024-07-23" msgstr "23 juillet 2024" #. type: TH #: fedora-44 fedora-rawhide #, no-wrap msgid "Linux man-pages 6.13" msgstr "Pages du manuel de Linux 6.13" #. type: TH #: mageia-cauldron #, no-wrap msgid "2026-02-08" msgstr "8 février 2026" #. type: TH #: mageia-cauldron #, no-wrap msgid "Linux man-pages 6.17" msgstr "Pages du manuel de Linux 6.17" #. type: Plain text #: mageia-cauldron #, fuzzy, 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" 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 Esys/types.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()\\[rs]n\");\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\\[rs]n\");\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]\\[rs]n\", 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\\[rs]n\");\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\\[rs]n\", nread);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" "#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" "/* Parcourt /proc/self/mountinfo pour trouver la ligne correspondant à \n" " l'ID de montage \\[aq]mount_id\\[aq]. (Une méthode plus simple consiste à\n" " installer et à utiliser la bibliothèque (\\[aq]libmount\\[aq] fournie par\n" " le projet \\[aq]util-linux\\[aq].) Ouvre le point de montage correspondant\n" " et renvoie le descripteur de fichier associé. */\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, \"Mauvais 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, \"Point de montage non trouvé\\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, \"Utilisation : %s [mount-path]\\en\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " /* L'entrée standard contient l'identifiant de montage et\n" " les informations de l'indicateur :\n" "\\&\n" " Ligne 1 : Emount_idE\n" " Ligne 2 : Ehandle_bytesE Ehandle_typeE Eoctets du descripteur en hexadécimalE\n" "\\&\n" " if (fgets(line1, sizeof(line1), stdin) == NULL ||\n" " fgets(line2, sizeof(line2), stdin) == NULL)\n" " {\n" " fprintf(stderr, \"mount_id ou descripteur de fichier absent\\en\");\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " mount_id = atoi(line1);\n" "\\&\n" " handle_bytes = strtoul(line2, &nextp, 0);\n" "\\&\n" " /* handle_bytes étant connu, on peut maintenant allouer la structure\n" " file_handle. */\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" " /* Récupère le descripteur de fichier du point de montage, soit en ouvrant\n" " le chemin indiqué dans la ligne de commande, soit en parcourant\n" " /proc/self/mounts pour retrouver un montage qui corresponde à\n" " \\[aq]mount_id\\[aq] qui a été reçu de 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" " /* Ouvre le fichier en utilisant l'indicateur et le point de montage. */\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" " /* On essaie de lire quelques octets depuis le fichier. */\n" "\\&\n" " nread = read(fd, buf, sizeof(buf));\n" " if (nread == -1)\n" " err(EXIT_FAILURE, \"read\");\n" "\\&\n" " printf(\"Lire %zd octets\\en\", nread);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" #. type: TH #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Linux man-pages (unreleased)" msgstr "Pages du manuel de Linux (non publiées)"