| 1 |
# French translation of manpages |
| 2 |
# This file is distributed under the same license as the manpages-l10n package. |
| 3 |
# Copyright © of this file: |
| 4 |
# Christophe Blaess <https://www.blaess.fr/christophe/>, 1996-2003. |
| 5 |
# Stéphan Rafin <[email protected]>, 2002. |
| 6 |
# Thierry Vignaud <[email protected]>, 1999, 2002. |
| 7 |
# François Micaux, 2002. |
| 8 |
# Alain Portal <[email protected]>, 2003-2008. |
| 9 |
# Jean-Philippe Guérard <[email protected]>, 2005-2006. |
| 10 |
# Jean-Luc Coulon (f5ibh) <[email protected]>, 2006-2007. |
| 11 |
# Julien Cristau <[email protected]>, 2006-2007. |
| 12 |
# Thomas Huriaux <[email protected]>, 2006-2008. |
| 13 |
# Nicolas François <[email protected]>, 2006-2008. |
| 14 |
# Florentin Duneau <[email protected]>, 2006-2010. |
| 15 |
# Simon Paillard <[email protected]>, 2006. |
| 16 |
# Denis Barbier <[email protected]>, 2006, 2010. |
| 17 |
# David Prévot <[email protected]>, 2010-2014. |
| 18 |
# Frédéric Hantrais <[email protected]>, 2013, 2014. |
| 19 |
# Jean-Philippe MENGUAL <[email protected]>, 2020. |
| 20 |
msgid "" |
| 21 |
msgstr "" |
| 22 |
"Project-Id-Version: manpages-l10n 4.21.0\n" |
| 23 |
"POT-Creation-Date: 2026-06-05 06:33+0200\n" |
| 24 |
"PO-Revision-Date: 2024-03-13 18:20+0100\n" |
| 25 |
"Last-Translator: Jean-Philippe MENGUAL <[email protected]>\n" |
| 26 |
"Language-Team: French <[email protected]>\n" |
| 27 |
"Language: fr\n" |
| 28 |
"MIME-Version: 1.0\n" |
| 29 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 30 |
"Content-Transfer-Encoding: 8bit\n" |
| 31 |
"Plural-Forms: nplurals=2; plural=n > 1;\n" |
| 32 |
"X-Generator: Lokalize 22.12.3\n" |
| 33 |
|
| 34 |
#. type: TH |
| 35 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 36 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 37 |
#, no-wrap |
| 38 |
msgid "open_by_handle_at" |
| 39 |
msgstr "open_by_handle_at" |
| 40 |
|
| 41 |
#. type: TH |
| 42 |
#: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed |
| 43 |
#, no-wrap |
| 44 |
msgid "2026-02-22" |
| 45 |
msgstr "22 février 2026" |
| 46 |
|
| 47 |
#. type: TH |
| 48 |
#: archlinux debian-unstable |
| 49 |
#, no-wrap |
| 50 |
msgid "Linux man-pages 6.18" |
| 51 |
msgstr "Pages du manuel de Linux 6.18" |
| 52 |
|
| 53 |
#. type: SH |
| 54 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 55 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 56 |
#, no-wrap |
| 57 |
msgid "NAME" |
| 58 |
msgstr "NOM" |
| 59 |
|
| 60 |
#. type: Plain text |
| 61 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 62 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 63 |
msgid "" |
| 64 |
"name_to_handle_at, open_by_handle_at - obtain handle for a pathname and open " |
| 65 |
"file via a handle" |
| 66 |
msgstr "" |
| 67 |
"name_to_handle_at, open_by_handle_at - Récupérer le gestionnaire d'un chemin " |
| 68 |
"et ouvrir le fichier au moyen d'un gestionnaire" |
| 69 |
|
| 70 |
#. type: SH |
| 71 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 72 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 73 |
#, no-wrap |
| 74 |
msgid "LIBRARY" |
| 75 |
msgstr "BIBLIOTHÈQUE" |
| 76 |
|
| 77 |
#. type: Plain text |
| 78 |
#: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron |
| 79 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 80 |
msgid "Standard C library (I<libc>,\\ I<-lc>)" |
| 81 |
msgstr "Bibliothèque C standard (I<libc>,\\ I<-lc>)" |
| 82 |
|
| 83 |
#. type: SH |
| 84 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 85 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 86 |
#, no-wrap |
| 87 |
msgid "SYNOPSIS" |
| 88 |
msgstr "SYNOPSIS" |
| 89 |
|
| 90 |
#. type: Plain text |
| 91 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 92 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 93 |
#, no-wrap |
| 94 |
msgid "" |
| 95 |
"B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n" |
| 96 |
"B<#include E<lt>fcntl.hE<gt>>\n" |
| 97 |
msgstr "" |
| 98 |
"B<#define _GNU_SOURCE> /* Consultez feature_test_macros(7) */\n" |
| 99 |
"B<#include E<lt>fcntl.hE<gt>>\n" |
| 100 |
|
| 101 |
#. type: Plain text |
| 102 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 103 |
#: opensuse-tumbleweed |
| 104 |
#, fuzzy, no-wrap |
| 105 |
#| msgid "" |
| 106 |
#| "B<int name_to_handle_at(int >I<dirfd>B<, const char *>I<pathname>B<,>\n" |
| 107 |
#| "B< struct file_handle *>I<handle>B<,>\n" |
| 108 |
#| "B< int *>I<mount_id>B<, int >I<flags>B<);>\n" |
| 109 |
#| "B<int open_by_handle_at(int >I<mount_fd>B<, struct file_handle *>I<handle>B<,>\n" |
| 110 |
#| "B< int >I<flags>B<);>\n" |
| 111 |
msgid "" |
| 112 |
"B<int name_to_handle_at(int >I<dirfd>B<, const char *>I<path>B<,>\n" |
| 113 |
"B< struct file_handle *>I<handle>B<,>\n" |
| 114 |
"B< int *>I<mount_id>B<, int >I<flags>B<);>\n" |
| 115 |
"B<int open_by_handle_at(int >I<mount_fd>B<, struct file_handle *>I<handle>B<,>\n" |
| 116 |
"B< int >I<flags>B<);>\n" |
| 117 |
msgstr "" |
| 118 |
"B<int name_to_handle_at(int >I<dirfd>B<, const char *>I<pathname>B<,>\n" |
| 119 |
"B< struct file_handle *>I<handle>B<,>\n" |
| 120 |
"B< int *>I<mount_id>B<, int >I<flags>B<);>\n" |
| 121 |
"B<int open_by_handle_at(int >I<mount_fd>B<, struct file_handle *>I<handle>B<,>\n" |
| 122 |
"B< int >I<flags>B<);>\n" |
| 123 |
|
| 124 |
#. type: SH |
| 125 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 126 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 127 |
#, no-wrap |
| 128 |
msgid "DESCRIPTION" |
| 129 |
msgstr "DESCRIPTION" |
| 130 |
|
| 131 |
#. type: Plain text |
| 132 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 133 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 134 |
msgid "" |
| 135 |
"The B<name_to_handle_at>() and B<open_by_handle_at>() system calls split " |
| 136 |
"the functionality of B<openat>(2) into two parts: B<name_to_handle_at>() " |
| 137 |
"returns an opaque handle that corresponds to a specified file; " |
| 138 |
"B<open_by_handle_at>() opens the file corresponding to a handle returned by " |
| 139 |
"a previous call to B<name_to_handle_at>() and returns an open file " |
| 140 |
"descriptor." |
| 141 |
msgstr "" |
| 142 |
"Les appels système B<name_to_handle_at>() et B<open_by_handle_at>() scindent " |
| 143 |
"la fonction de B<openat>(2) en deux parties : B<name_to_handle_at>() renvoie " |
| 144 |
"un gestionnaire opaque qui correspond à un fichier indiqué ; " |
| 145 |
"B<open_by_handle_at>() ouvre le fichier correspondant à un gestionnaire " |
| 146 |
"renvoyé par un appel antérieur à B<name_to_handle_at>() et renvoie le " |
| 147 |
"descripteur d'un fichier ouvert." |
| 148 |
|
| 149 |
#. type: SS |
| 150 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 151 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 152 |
#, no-wrap |
| 153 |
msgid "name_to_handle_at()" |
| 154 |
msgstr "name_to_handle_at()" |
| 155 |
|
| 156 |
#. type: Plain text |
| 157 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 158 |
#: opensuse-tumbleweed |
| 159 |
#, fuzzy |
| 160 |
#| msgid "" |
| 161 |
#| "The B<name_to_handle_at>() system call returns a file handle and a mount " |
| 162 |
#| "ID corresponding to the file specified by the I<dirfd> and I<pathname> " |
| 163 |
#| "arguments. The file handle is returned via the argument I<handle>, which " |
| 164 |
#| "is a pointer to a structure of the following form:" |
| 165 |
msgid "" |
| 166 |
"The B<name_to_handle_at>() system call returns a file handle and a mount ID " |
| 167 |
"corresponding to the file specified by the I<dirfd> and I<path> arguments. " |
| 168 |
"The file handle is returned via the argument I<handle>, which is a pointer " |
| 169 |
"to a structure of the following form:" |
| 170 |
msgstr "" |
| 171 |
"L'appel système B<name_to_handle_at>() renvoie un gestionnaire de fichier et " |
| 172 |
"un identifiant de montage (« mount ID ») correspondant au fichier désigné " |
| 173 |
"par les arguments I<dirfd> et I<pathname>. Le gestionnaire de fichier est " |
| 174 |
"renvoyé au moyen de l'argument I<handle>. Cet argument est un pointeur vers " |
| 175 |
"une structure qui présente la forme suivante :" |
| 176 |
|
| 177 |
#. type: Plain text |
| 178 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 179 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 180 |
#, no-wrap |
| 181 |
msgid "" |
| 182 |
"struct file_handle {\n" |
| 183 |
" unsigned int handle_bytes; /* Size of f_handle [in, out] */\n" |
| 184 |
" int handle_type; /* Handle type [out] */\n" |
| 185 |
" unsigned char f_handle[0]; /* File identifier (sized by\n" |
| 186 |
" caller) [out] */\n" |
| 187 |
"};\n" |
| 188 |
msgstr "" |
| 189 |
"struct file_handle {\n" |
| 190 |
" unsigned int handle_bytes; /* taille de f_handle [in, out] */\n" |
| 191 |
" int handle_type; /* type du gestionnaire [out] */\n" |
| 192 |
" unsigned char f_handle[0]; /* identifiant du fichier (taille\n" |
| 193 |
" définie par l’appelant) [out] */\n" |
| 194 |
"};\n" |
| 195 |
|
| 196 |
#. type: Plain text |
| 197 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 198 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 199 |
msgid "" |
| 200 |
"It is the caller's responsibility to allocate the structure with a size " |
| 201 |
"large enough to hold the handle returned in I<f_handle>. Before the call, " |
| 202 |
"the I<handle_bytes> field should be initialized to contain the allocated " |
| 203 |
"size for I<f_handle>. (The constant B<MAX_HANDLE_SZ>, defined in " |
| 204 |
"I<E<lt>fcntl.hE<gt>>, specifies the maximum expected size for a file " |
| 205 |
"handle. It is not a guaranteed upper limit as future filesystems may " |
| 206 |
"require more space.) Upon successful return, the I<handle_bytes> field is " |
| 207 |
"updated to contain the number of bytes actually written to I<f_handle>." |
| 208 |
msgstr "" |
| 209 |
"L'appelant à l'origine de l'appel doit s'assurer que la structure est créée " |
| 210 |
"avec une taille suffisante pour contenir le gestionnaire renvoyé dans " |
| 211 |
"I<f_handle>. Avant l'appel, le champ I<handle_bytes> devrait être initialisé " |
| 212 |
"de sorte que l'espace alloué puisse recevoir I<f_handle>. (La constante " |
| 213 |
"B<MAX_HANDLE_SZ>, définie dans I<E<lt>fcntl.hE<gt>>, précise la taille " |
| 214 |
"maximale autorisée pour un gestionnaire de fichier. La limite supérieure " |
| 215 |
"n'est pas garantie car de futurs systèmes de fichiers pourraient avoir " |
| 216 |
"besoin de davantage d'espace). Lorsque l'appel réussit, le champ " |
| 217 |
"I<handle_bytes> est mis à jour afin de contenir le nombre d'octets " |
| 218 |
"effectivement écrits dans I<f_handle>." |
| 219 |
|
| 220 |
#. type: Plain text |
| 221 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 222 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 223 |
msgid "" |
| 224 |
"The caller can discover the required size for the I<file_handle> structure " |
| 225 |
"by making a call in which I<handle-E<gt>handle_bytes> is zero; in this case, " |
| 226 |
"the call fails with the error B<EOVERFLOW> and I<handle-E<gt>handle_bytes> " |
| 227 |
"is set to indicate the required size; the caller can then use this " |
| 228 |
"information to allocate a structure of the correct size (see EXAMPLES " |
| 229 |
"below). Some care is needed here as B<EOVERFLOW> can also indicate that no " |
| 230 |
"file handle is available for this particular name in a filesystem which does " |
| 231 |
"normally support file-handle lookup. This case can be detected when the " |
| 232 |
"B<EOVERFLOW> error is returned without I<handle_bytes> being increased." |
| 233 |
msgstr "" |
| 234 |
"L'appelant peut prendre connaissance de l'espace nécessaire à la structure " |
| 235 |
"I<file_handle> en effectuant un appel dans lequel I<handle-" |
| 236 |
"E<gt>handle_bytes> vaut zéro ; dans ce cas, l'appel échoue en renvoyant " |
| 237 |
"l'erreur B<EOVERFLOW> et I<handle-E<gt>handle_bytes> prend pour valeur la " |
| 238 |
"taille requise ; l'appelant peut alors utiliser cette information pour " |
| 239 |
"allouer une structure ayant la taille convenable (consultez EXEMPLES ci-" |
| 240 |
"dessous). Il faut faire attention ici car B<EOVERFLOW> peut indiquer " |
| 241 |
"qu'aucun gestionnaire de fichier n'est disponible pour ce nom particulier " |
| 242 |
"dans un système de fichiers qui prend normalement en charge la recherche de " |
| 243 |
"gestionnaire de fichiers. Ce cas peut se détecter quand l'erreur " |
| 244 |
"B<EOVERFLOW> est renvoyée sans que I<handle_bytes> ne soit augmenté." |
| 245 |
|
| 246 |
#. type: Plain text |
| 247 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 248 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 249 |
msgid "" |
| 250 |
"Other than the use of the I<handle_bytes> field, the caller should treat the " |
| 251 |
"I<file_handle> structure as an opaque data type: the I<handle_type> and " |
| 252 |
"I<f_handle> fields can be used in a subsequent call to " |
| 253 |
"B<open_by_handle_at>(). The caller can also use the opaque I<file_handle> " |
| 254 |
"to compare the identity of filesystem objects that were queried at different " |
| 255 |
"times and possibly at different paths. The B<fanotify>(7) subsystem can " |
| 256 |
"report events with an information record containing a I<file_handle> to " |
| 257 |
"identify the filesystem object." |
| 258 |
msgstr "" |
| 259 |
|
| 260 |
#. type: Plain text |
| 261 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 262 |
#: opensuse-tumbleweed |
| 263 |
#, fuzzy |
| 264 |
#| msgid "" |
| 265 |
#| "The I<flags> argument is a bit mask constructed by ORing together zero or " |
| 266 |
#| "more of B<AT_HANDLE_FID>, B<AT_EMPTY_PATH>, and B<AT_SYMLINK_FOLLOW>, " |
| 267 |
#| "described below." |
| 268 |
msgid "" |
| 269 |
"The I<flags> argument is a bit mask constructed by ORing together zero or " |
| 270 |
"more of B<AT_HANDLE_FID>, B<AT_HANDLE_MNT_ID_UNIQUE>, " |
| 271 |
"B<AT_HANDLE_CONNECTABLE>, B<AT_EMPTY_PATH>, and B<AT_SYMLINK_FOLLOW>, " |
| 272 |
"described below." |
| 273 |
msgstr "" |
| 274 |
"L'argument I<flags> est un masque de bits construit par I<OU> binaire entre " |
| 275 |
"zéro ou plus de B<AT_EMPTY_PATH> et B<AT_SYMLINK_FOLLOW>, décrits plus bas." |
| 276 |
|
| 277 |
#. commit 96b2b072ee62be8ae68c8ecf14854c4d0505a8f8 |
| 278 |
#. type: Plain text |
| 279 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 280 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 281 |
msgid "" |
| 282 |
"When I<flags> contain the B<AT_HANDLE_FID> (since Linux 6.5) flag, the " |
| 283 |
"caller indicates that the returned I<file_handle> is needed to identify the " |
| 284 |
"filesystem object, and not for opening the file later, so it should be " |
| 285 |
"expected that a subsequent call to B<open_by_handle_at>() with the returned " |
| 286 |
"I<file_handle> may fail." |
| 287 |
msgstr "" |
| 288 |
|
| 289 |
#. commit 4356d575ef0f39a3e8e0ce0c40d84ce900ac3b61 |
| 290 |
#. type: Plain text |
| 291 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 292 |
#: opensuse-tumbleweed |
| 293 |
msgid "" |
| 294 |
"When I<flags> contain the B<AT_HANDLE_MNT_ID_UNIQUE> (since Linux 6.12) " |
| 295 |
"flag, the caller indicates that the width of the I<mount_id> buffer is at " |
| 296 |
"least 64 bits, and then the mount id returned in that buffer is the unique " |
| 297 |
"mount id as the one returned by B<statx>(2) with the B<STATX_MNT_ID_UNIQUE> " |
| 298 |
"flag." |
| 299 |
msgstr "" |
| 300 |
|
| 301 |
#. commit a20853ab8296d4a8754482cb5e9adde8ab426a25 |
| 302 |
#. type: Plain text |
| 303 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 304 |
#: opensuse-tumbleweed |
| 305 |
msgid "" |
| 306 |
"When I<flags> contain the B<AT_HANDLE_CONNECTABLE> (since Linux 6.13) flag, " |
| 307 |
"the caller indicates that the returned I<file_handle> is needed to open a " |
| 308 |
"file with known path later, so it should be expected that a subsequent call " |
| 309 |
"to B<open_by_handle_at>() with the returned I<file_handle> may fail if the " |
| 310 |
"file was moved, but otherwise, the path of the opened file is expected to be " |
| 311 |
"visible from the I</proc/>pidI</fd/>* magic link. This flag can not be used " |
| 312 |
"in combination with the flags B<AT_HANDLE_FID> and/or B<AT_EMPTY_PATH>." |
| 313 |
msgstr "" |
| 314 |
|
| 315 |
#. type: Plain text |
| 316 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 317 |
#: opensuse-tumbleweed |
| 318 |
#, fuzzy |
| 319 |
#| msgid "" |
| 320 |
#| "Together, the I<pathname> and I<dirfd> arguments identify the file for " |
| 321 |
#| "which a handle is to be obtained. There are four distinct cases:" |
| 322 |
msgid "" |
| 323 |
"Together, the I<path> and I<dirfd> arguments identify the file for which a " |
| 324 |
"handle is to be obtained. There are four distinct cases:" |
| 325 |
msgstr "" |
| 326 |
"Ensemble, les arguments I<pathname> et I<dirfd> désignent le fichier pour " |
| 327 |
"lequel on souhaite obtenir un gestionnaire. On distingue quatre cas : " |
| 328 |
|
| 329 |
#. type: IP |
| 330 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 331 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 332 |
#, no-wrap |
| 333 |
msgid "\\[bu]" |
| 334 |
msgstr "-" |
| 335 |
|
| 336 |
#. type: Plain text |
| 337 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 338 |
#: opensuse-tumbleweed |
| 339 |
#, fuzzy |
| 340 |
#| msgid "" |
| 341 |
#| "If I<pathname> is a nonempty string containing an absolute pathname, then " |
| 342 |
#| "a handle is returned for the file referred to by that pathname. In this " |
| 343 |
#| "case, I<dirfd> is ignored." |
| 344 |
msgid "" |
| 345 |
"If I<path> is a nonempty string containing an absolute pathname, then a " |
| 346 |
"handle is returned for the file referred to by that pathname. In this case, " |
| 347 |
"I<dirfd> is ignored." |
| 348 |
msgstr "" |
| 349 |
"Si I<pathname> est une chaîne non vide contenant un chemin d'accès absolu, " |
| 350 |
"alors un gestionnaire est renvoyé pour le fichier indiqué par ce chemin. " |
| 351 |
"Dans ce cas, I<dirfd> est ignoré." |
| 352 |
|
| 353 |
#. type: Plain text |
| 354 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 355 |
#: opensuse-tumbleweed |
| 356 |
#, fuzzy |
| 357 |
#| msgid "" |
| 358 |
#| "If I<pathname> is a nonempty string containing a relative pathname and " |
| 359 |
#| "I<dirfd> has the special value B<AT_FDCWD>, then I<pathname> is " |
| 360 |
#| "interpreted relative to the current working directory of the caller, and " |
| 361 |
#| "a handle is returned for the file to which it refers." |
| 362 |
msgid "" |
| 363 |
"If I<path> is a nonempty string containing a relative pathname and I<dirfd> " |
| 364 |
"has the special value B<AT_FDCWD>, then I<path> is interpreted relative to " |
| 365 |
"the current working directory of the caller, and a handle is returned for " |
| 366 |
"the file to which it refers." |
| 367 |
msgstr "" |
| 368 |
"Si I<pathname> est une chaîne non vide contenant un chemin relatif, et si " |
| 369 |
"I<dirfd> a la valeur spéciale B<AT_FDCWD>, alors I<pathname> est interprété " |
| 370 |
"par rapport au répertoire courant du processus appelant, et un gestionnaire " |
| 371 |
"est renvoyé pour le fichier indiqué par le chemin." |
| 372 |
|
| 373 |
#. type: Plain text |
| 374 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 375 |
#: opensuse-tumbleweed |
| 376 |
#, fuzzy |
| 377 |
#| msgid "" |
| 378 |
#| "If I<pathname> is a nonempty string containing a relative pathname and " |
| 379 |
#| "I<dirfd> is a file descriptor referring to a directory, then I<pathname> " |
| 380 |
#| "is interpreted relative to the directory referred to by I<dirfd>, and a " |
| 381 |
#| "handle is returned for the file to which it refers. (See B<openat>(2) " |
| 382 |
#| "for an explanation of why \"directory file descriptors\" are useful.)" |
| 383 |
msgid "" |
| 384 |
"If I<path> is a nonempty string containing a relative pathname and I<dirfd> " |
| 385 |
"is a file descriptor referring to a directory, then I<path> is interpreted " |
| 386 |
"relative to the directory referred to by I<dirfd>, and a handle is returned " |
| 387 |
"for the file to which it refers. (See B<openat>(2) for an explanation of " |
| 388 |
"why \"directory file descriptors\" are useful.)" |
| 389 |
msgstr "" |
| 390 |
"Si I<pathname> est une chaîne non vide contenant un chemin d'accès relatif " |
| 391 |
"et si I<dirfd> est le descripteur de fichier d'un répertoire, alors " |
| 392 |
"I<pathname> est interprété par rapport au répertoire désigné par I<dirfd>, " |
| 393 |
"et un gestionnaire est renvoyé pour le fichier indiqué par le chemin. " |
| 394 |
"(Consultez B<openat>(3) si vous souhaitez comprendre à quoi servent les " |
| 395 |
"« descripteurs de fichier de répertoires »)." |
| 396 |
|
| 397 |
#. type: Plain text |
| 398 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 399 |
#: opensuse-tumbleweed |
| 400 |
#, fuzzy |
| 401 |
#| msgid "" |
| 402 |
#| "If I<pathname> is an empty string and I<flags> specifies the value " |
| 403 |
#| "B<AT_EMPTY_PATH>, then I<dirfd> can be an open file descriptor referring " |
| 404 |
#| "to any type of file, or B<AT_FDCWD>, meaning the current working " |
| 405 |
#| "directory, and a handle is returned for the file to which it refers." |
| 406 |
msgid "" |
| 407 |
"If I<path> is an empty string and I<flags> specifies the value " |
| 408 |
"B<AT_EMPTY_PATH>, then I<dirfd> can be an open file descriptor referring to " |
| 409 |
"any type of file, or B<AT_FDCWD>, meaning the current working directory, and " |
| 410 |
"a handle is returned for the file to which it refers." |
| 411 |
msgstr "" |
| 412 |
"Si I<pathname> est une chaîne vide, et si I<flags> précise la valeur de " |
| 413 |
"B<AT_EMPTY_PATH>, alors I<dirfd> peut être un descripteur de fichiers ouvert " |
| 414 |
"faisant référence à n'importe quel type de fichier ou à B<AT_FDCWD> " |
| 415 |
"(répertoire de travail courant), et un gestionnaire est renvoyé pour le " |
| 416 |
"fichier auquel il fait référence." |
| 417 |
|
| 418 |
#. type: Plain text |
| 419 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 420 |
#: opensuse-tumbleweed |
| 421 |
#, fuzzy |
| 422 |
#| msgid "" |
| 423 |
#| "The I<mount_id> argument returns an identifier for the filesystem mount " |
| 424 |
#| "that corresponds to I<pathname>. This corresponds to the first field in " |
| 425 |
#| "one of the records in I</proc/self/mountinfo>. Opening the pathname in " |
| 426 |
#| "the fifth field of that record yields a file descriptor for the mount " |
| 427 |
#| "point; that file descriptor can be used in a subsequent call to " |
| 428 |
#| "B<open_by_handle_at>(). I<mount_id> is returned both for a successful " |
| 429 |
#| "call and for a call that results in the error B<EOVERFLOW>." |
| 430 |
msgid "" |
| 431 |
"The I<mount_id> argument returns an identifier for the filesystem mount that " |
| 432 |
"corresponds to I<path>. This corresponds to the first field in one of the " |
| 433 |
"records in I</proc/self/mountinfo>. Opening the pathname in the fifth field " |
| 434 |
"of that record yields a file descriptor for the mount point; that file " |
| 435 |
"descriptor can be used in a subsequent call to B<open_by_handle_at>(). " |
| 436 |
"I<mount_id> is returned both for a successful call and for a call that " |
| 437 |
"results in the error B<EOVERFLOW>." |
| 438 |
msgstr "" |
| 439 |
"L'argument I<mount_id> renvoie un identifiant pour le point de montage du " |
| 440 |
"système de fichiers correspondant à I<pathname>. Cet identifiant correspond " |
| 441 |
"au premier champ des entrées de I</proc/self/mountinfo>. L'ouverture du " |
| 442 |
"chemin indiqué dans le cinquième champ délivre un descripteur de fichier " |
| 443 |
"pour le point de montage ; ce descripteur de fichier peut être utilisé par " |
| 444 |
"la suite lors d'un appel à B<open_by_handle_at>(). I<mount_id> est renvoyé " |
| 445 |
"tant en cas de succès qu'en cas d'erreur B<EOVERFLOW> de l'appel." |
| 446 |
|
| 447 |
#. type: Plain text |
| 448 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 449 |
#: opensuse-tumbleweed |
| 450 |
#, fuzzy |
| 451 |
#| msgid "" |
| 452 |
#| "By default, B<name_to_handle_at>() does not dereference I<pathname> if " |
| 453 |
#| "it is a symbolic link, and thus returns a handle for the link itself. If " |
| 454 |
#| "B<AT_SYMLINK_FOLLOW> is specified in I<flags>, I<pathname> is " |
| 455 |
#| "dereferenced if it is a symbolic link (so that the call returns a handle " |
| 456 |
#| "for the file referred to by the link)." |
| 457 |
msgid "" |
| 458 |
"By default, B<name_to_handle_at>() does not dereference I<path> if it is a " |
| 459 |
"symbolic link, and thus returns a handle for the link itself. If " |
| 460 |
"B<AT_SYMLINK_FOLLOW> is specified in I<flags>, I<path> is dereferenced if it " |
| 461 |
"is a symbolic link (so that the call returns a handle for the file referred " |
| 462 |
"to by the link)." |
| 463 |
msgstr "" |
| 464 |
"Par défaut, B<name_to_handle_at>() ne déréférence pas I<pathname> s'il " |
| 465 |
"s'agit d'un lien symbolique, et donc renvoie un gestionnaire pour le lien " |
| 466 |
"lui-même. Si B<AT_SYMLINK_FOLLOW> est précisé dans I<flags>, I<pathname> est " |
| 467 |
"déréférencé s'il s'agit d'un lien symbolique (de sorte que l'appel renvoie " |
| 468 |
"un indicateur pour le fichier vers lequel pointe le lien symbolique)." |
| 469 |
|
| 470 |
#. commit 20fa19027286983ab2734b5910c4a687436e0c31 |
| 471 |
#. type: Plain text |
| 472 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 473 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 474 |
msgid "" |
| 475 |
"B<name_to_handle_at>() does not trigger a mount when the final component of " |
| 476 |
"the pathname is an automount point. When a filesystem supports both file " |
| 477 |
"handles and automount points, a B<name_to_handle_at>() call on an automount " |
| 478 |
"point will return with error B<EOVERFLOW> without having increased " |
| 479 |
"I<handle_bytes>. This can happen since Linux 4.13 with NFS when accessing a " |
| 480 |
"directory which is on a separate filesystem on the server. In this case, " |
| 481 |
"the automount can be triggered by adding a \"/\" to the end of the pathname." |
| 482 |
msgstr "" |
| 483 |
"B<name_to_handle_at>() ne récupère pas un montage quand le composant final " |
| 484 |
"du chemin est un point de montage automatique. Quand un système de fichiers " |
| 485 |
"gère à la fois les gestionnaires de fichier et les points de montage " |
| 486 |
"automatique, un appel B<name_to_handle_at>() sur un point de montage " |
| 487 |
"automatique renverra une erreur B<EOVERFLOW> sans augmenter I<handle_bytes>. " |
| 488 |
"Cela peut arriver depuis Linux 4.13 avec NFS lors d'un accès à un répertoire " |
| 489 |
"sur un système de fichiers séparé du serveur. Dans ce cas, le montage " |
| 490 |
"automatique peut être provoqué en ajoutant un « / » à la fin du chemin. " |
| 491 |
|
| 492 |
#. type: SS |
| 493 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 494 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 495 |
#, no-wrap |
| 496 |
msgid "open_by_handle_at()" |
| 497 |
msgstr "open_by_handle_at()" |
| 498 |
|
| 499 |
#. type: Plain text |
| 500 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 501 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 502 |
msgid "" |
| 503 |
"The B<open_by_handle_at>() system call opens the file referred to by " |
| 504 |
"I<handle>, a file handle returned by a previous call to " |
| 505 |
"B<name_to_handle_at>()." |
| 506 |
msgstr "" |
| 507 |
"L'appel système B<open_by_handle_at>() ouvre le fichier auquel I<handle> " |
| 508 |
"fait référence, via un indicateur de fichier renvoyé lors d'un précédent " |
| 509 |
"appel à B<name_to_handle_at>()." |
| 510 |
|
| 511 |
#. type: Plain text |
| 512 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 513 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 514 |
msgid "" |
| 515 |
"The I<mount_fd> argument is a file descriptor for any object (file, " |
| 516 |
"directory, etc.) in the mounted filesystem with respect to which I<handle> " |
| 517 |
"should be interpreted. The special value B<AT_FDCWD> can be specified, " |
| 518 |
"meaning the current working directory of the caller." |
| 519 |
msgstr "" |
| 520 |
"L'argument I<mount_fd> est un descripteur de fichier pour n'importe quel " |
| 521 |
"type d'objet (fichier, répertoire, etc.) du système de fichiers monté qui " |
| 522 |
"permet d'interpréter l'indicateur de fichier (I<handle>). La valeur spéciale " |
| 523 |
"B<AT_FDCWD> peut être précisée, et indique le répertoire courant du " |
| 524 |
"processus appelant. " |
| 525 |
|
| 526 |
#. type: Plain text |
| 527 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 528 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 529 |
msgid "" |
| 530 |
"The I<flags> argument is as for B<open>(2). If I<handle> refers to a " |
| 531 |
"symbolic link, the caller must specify the B<O_PATH> flag, and the symbolic " |
| 532 |
"link is not dereferenced; the B<O_NOFOLLOW> flag, if specified, is ignored." |
| 533 |
msgstr "" |
| 534 |
"L'argument I<flags> a la même fonction que pour B<open>(2). Si l'indicateur " |
| 535 |
"I<handle> fait référence à un lien symbolique, le processus appelant doit " |
| 536 |
"préciser l'attribut B<O_PATH> et le lien symbolique n'est pas déréférencé. " |
| 537 |
"L'attribut B<O_NOFOLLOW> est ignoré." |
| 538 |
|
| 539 |
#. type: Plain text |
| 540 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 541 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 542 |
msgid "" |
| 543 |
"The caller must have the B<CAP_DAC_READ_SEARCH> capability to invoke " |
| 544 |
"B<open_by_handle_at>()." |
| 545 |
msgstr "" |
| 546 |
"L'appelant doit avoir la capacité B<CAP_DAC_READ_SEARCH> pour utiliser " |
| 547 |
"B<open_by_handle_at>()." |
| 548 |
|
| 549 |
#. type: SH |
| 550 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 551 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 552 |
#, no-wrap |
| 553 |
msgid "RETURN VALUE" |
| 554 |
msgstr "VALEUR RENVOYÉE" |
| 555 |
|
| 556 |
#. type: Plain text |
| 557 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 558 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 559 |
msgid "" |
| 560 |
"On success, B<name_to_handle_at>() returns 0, and B<open_by_handle_at>() " |
| 561 |
"returns a file descriptor (a nonnegative integer)." |
| 562 |
msgstr "" |
| 563 |
"Lorsqu'il réussit, l'appel B<name_to_handle_at>() renvoie B<0> et " |
| 564 |
"B<open_by_handle_at>() renvoie un descripteur de fichier (un entier non " |
| 565 |
"négatif)." |
| 566 |
|
| 567 |
#. type: Plain text |
| 568 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 569 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 570 |
msgid "" |
| 571 |
"In the event of an error, both system calls return -1 and set I<errno> to " |
| 572 |
"indicate the error." |
| 573 |
msgstr "" |
| 574 |
"En cas d'échec, les deux appels renvoient B<-1> et définissent I<errno> pour " |
| 575 |
"indiquer l'erreur." |
| 576 |
|
| 577 |
#. type: SH |
| 578 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 579 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 580 |
#, no-wrap |
| 581 |
msgid "ERRORS" |
| 582 |
msgstr "ERREURS" |
| 583 |
|
| 584 |
#. type: Plain text |
| 585 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 586 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 587 |
msgid "" |
| 588 |
"B<name_to_handle_at>() and B<open_by_handle_at>() can fail for the same " |
| 589 |
"errors as B<openat>(2). In addition, they can fail with the errors noted " |
| 590 |
"below." |
| 591 |
msgstr "" |
| 592 |
"Les appels B<name_to_handle_at>() et B<open_by_handle_at>() peuvent échouer " |
| 593 |
"pour les mêmes raisons que B<openat>(2). En outre, ils peuvent également " |
| 594 |
"échouer pour les motifs décrits plus bas. " |
| 595 |
|
| 596 |
#. type: Plain text |
| 597 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 598 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 599 |
msgid "B<name_to_handle_at>() can fail with the following errors:" |
| 600 |
msgstr "B<name_to_handle_at>() peut échouer avec les erreurs suivantes :" |
| 601 |
|
| 602 |
#. type: TP |
| 603 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 604 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 605 |
#, no-wrap |
| 606 |
msgid "B<EFAULT>" |
| 607 |
msgstr "B<EFAULT>" |
| 608 |
|
| 609 |
#. type: Plain text |
| 610 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 611 |
#: opensuse-tumbleweed |
| 612 |
#, fuzzy |
| 613 |
#| msgid "" |
| 614 |
#| "I<pathname>, I<mount_id>, or I<handle> points outside your accessible " |
| 615 |
#| "address space." |
| 616 |
msgid "" |
| 617 |
"I<path>, I<mount_id>, or I<handle> points outside your accessible address " |
| 618 |
"space." |
| 619 |
msgstr "" |
| 620 |
"I<pathname>, I<mount_id> ou I<handle> pointe en dehors de l'espace " |
| 621 |
"d'adressage accessible." |
| 622 |
|
| 623 |
#. type: TP |
| 624 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 625 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 626 |
#, no-wrap |
| 627 |
msgid "B<EINVAL>" |
| 628 |
msgstr "B<EINVAL>" |
| 629 |
|
| 630 |
#. type: Plain text |
| 631 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 632 |
#: opensuse-tumbleweed |
| 633 |
#, fuzzy |
| 634 |
#| msgid "I<flags> includes an invalid bit value." |
| 635 |
msgid "I<flags> includes an invalid bit value or an invalid bit combination." |
| 636 |
msgstr "I<flags> comprend un bit incorrect." |
| 637 |
|
| 638 |
#. type: Plain text |
| 639 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 640 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 641 |
msgid "I<handle-E<gt>handle_bytes> is greater than B<MAX_HANDLE_SZ>." |
| 642 |
msgstr "I<handle-E<gt>handle_bytes> est supérieur à B<MAX_HANDLE_SZ>." |
| 643 |
|
| 644 |
#. type: TP |
| 645 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 646 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 647 |
#, no-wrap |
| 648 |
msgid "B<ENOENT>" |
| 649 |
msgstr "B<ENOENT>" |
| 650 |
|
| 651 |
#. type: Plain text |
| 652 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 653 |
#: opensuse-tumbleweed |
| 654 |
#, fuzzy |
| 655 |
#| msgid "" |
| 656 |
#| "I<pathname> is an empty string, but B<AT_EMPTY_PATH> was not specified in " |
| 657 |
#| "I<flags>." |
| 658 |
msgid "" |
| 659 |
"I<path> is an empty string, but B<AT_EMPTY_PATH> was not specified in " |
| 660 |
"I<flags>." |
| 661 |
msgstr "" |
| 662 |
"I<pathname> est une chaîne vide et B<AT_EMPTY_PATH> n’était pas indiqué dans " |
| 663 |
"I<flags>." |
| 664 |
|
| 665 |
#. type: TP |
| 666 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 667 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 668 |
#, no-wrap |
| 669 |
msgid "B<ENOTDIR>" |
| 670 |
msgstr "B<ENOTDIR>" |
| 671 |
|
| 672 |
#. type: Plain text |
| 673 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 674 |
#: opensuse-tumbleweed |
| 675 |
#, fuzzy |
| 676 |
#| msgid "" |
| 677 |
#| "The file descriptor supplied in I<dirfd> does not refer to a directory, " |
| 678 |
#| "and it is not the case that both I<flags> includes B<AT_EMPTY_PATH> and " |
| 679 |
#| "I<pathname> is an empty string." |
| 680 |
msgid "" |
| 681 |
"The file descriptor supplied in I<dirfd> does not refer to a directory, and " |
| 682 |
"it is not the case that both I<flags> includes B<AT_EMPTY_PATH> and I<path> " |
| 683 |
"is an empty string." |
| 684 |
msgstr "" |
| 685 |
"Le descripteur de fichiers fourni dans I<dirfd> ne fait pas référence à un " |
| 686 |
"répertoire, et il ne s'agit pas du cas où I<flags> comprend B<AT_EMPTY_PATH> " |
| 687 |
"et I<pathname> est une chaîne vide." |
| 688 |
|
| 689 |
#. type: TP |
| 690 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 691 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 692 |
#, no-wrap |
| 693 |
msgid "B<EOPNOTSUPP>" |
| 694 |
msgstr "B<EOPNOTSUPP>" |
| 695 |
|
| 696 |
#. type: Plain text |
| 697 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 698 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 699 |
msgid "" |
| 700 |
"The filesystem does not support decoding of a pathname to a file handle." |
| 701 |
msgstr "" |
| 702 |
"Le système de fichiers ne permet pas la transcription du chemin de fichier " |
| 703 |
"en indicateur de fichier." |
| 704 |
|
| 705 |
#. type: TP |
| 706 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 707 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 708 |
#, no-wrap |
| 709 |
msgid "B<EOVERFLOW>" |
| 710 |
msgstr "B<EOVERFLOW>" |
| 711 |
|
| 712 |
#. type: Plain text |
| 713 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 714 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 715 |
msgid "" |
| 716 |
"The I<handle-E<gt>handle_bytes> value passed into the call was too small. " |
| 717 |
"When this error occurs, I<handle-E<gt>handle_bytes> is updated to indicate " |
| 718 |
"the required size for the handle." |
| 719 |
msgstr "" |
| 720 |
"La valeur I<handle-E<gt>handle_bytes> transmise dans l'appel est trop " |
| 721 |
"faible. Lorsque cette erreur se produit, I<handle-E<gt>handle_bytes> est " |
| 722 |
"modifié afin d'indiquer la taille requise pour cet indicateur. " |
| 723 |
|
| 724 |
#. type: Plain text |
| 725 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 726 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 727 |
msgid "B<open_by_handle_at>() can fail with the following errors:" |
| 728 |
msgstr "B<open_by_handle_at>() peut échouer avec les erreurs suivantes :" |
| 729 |
|
| 730 |
#. type: TP |
| 731 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 732 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 733 |
#, no-wrap |
| 734 |
msgid "B<EBADF>" |
| 735 |
msgstr "B<EBADF>" |
| 736 |
|
| 737 |
#. type: Plain text |
| 738 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 739 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 740 |
msgid "I<mount_fd> is not an open file descriptor." |
| 741 |
msgstr "I<mount_fd> n'est pas un descripteur de fichier ouvert." |
| 742 |
|
| 743 |
#. type: Plain text |
| 744 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 745 |
#: opensuse-tumbleweed |
| 746 |
msgid "" |
| 747 |
"I<path> is relative but I<dirfd> is neither B<AT_FDCWD> nor a valid file " |
| 748 |
"descriptor." |
| 749 |
msgstr "" |
| 750 |
"I<path> est relatif mais I<dirfd> n'est ni B<AT_FDWCD> ni un descripteur de " |
| 751 |
"fichier valable." |
| 752 |
|
| 753 |
#. type: Plain text |
| 754 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 755 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 756 |
msgid "I<handle> points outside your accessible address space." |
| 757 |
msgstr "I<handle> pointe en dehors de l'espace d'adressage accessible." |
| 758 |
|
| 759 |
#. type: Plain text |
| 760 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 761 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 762 |
msgid "" |
| 763 |
"I<handle-E<gt>handle_bytes> is greater than B<MAX_HANDLE_SZ> or is equal to " |
| 764 |
"zero." |
| 765 |
msgstr "" |
| 766 |
"I<handle-E<gt>handle_bytes> est supérieur à B<MAX_HANDLE_SZ> ou égal à zéro." |
| 767 |
|
| 768 |
#. type: TP |
| 769 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 770 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 771 |
#, no-wrap |
| 772 |
msgid "B<ELOOP>" |
| 773 |
msgstr "B<ELOOP>" |
| 774 |
|
| 775 |
#. type: Plain text |
| 776 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 777 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 778 |
msgid "" |
| 779 |
"I<handle> refers to a symbolic link, but B<O_PATH> was not specified in " |
| 780 |
"I<flags>." |
| 781 |
msgstr "" |
| 782 |
"I<handle> correspond à un lien symbolique et B<O_PATH> n’était pas indiqué " |
| 783 |
"dans I<flags>." |
| 784 |
|
| 785 |
#. type: TP |
| 786 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 787 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 788 |
#, no-wrap |
| 789 |
msgid "B<EPERM>" |
| 790 |
msgstr "B<EPERM>" |
| 791 |
|
| 792 |
#. type: Plain text |
| 793 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 794 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 795 |
msgid "The caller does not have the B<CAP_DAC_READ_SEARCH> capability." |
| 796 |
msgstr "L'appelant n'a pas la capacité B<CAP_DAC_READ_SEARCH>." |
| 797 |
|
| 798 |
#. type: TP |
| 799 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 800 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 801 |
#, no-wrap |
| 802 |
msgid "B<ESTALE>" |
| 803 |
msgstr "B<ESTALE>" |
| 804 |
|
| 805 |
#. type: Plain text |
| 806 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 807 |
#: opensuse-tumbleweed |
| 808 |
msgid "" |
| 809 |
"The specified I<handle> is not valid for opening a file. This error will " |
| 810 |
"occur if, for example, the file has been deleted. This error can also occur " |
| 811 |
"if the I<handle> was acquired using the B<AT_HANDLE_FID> flag and the " |
| 812 |
"filesystem does not support B<open_by_handle_at>(). This error can also " |
| 813 |
"occur if the I<handle> was acquired using the B<AT_HANDLE_CONNECTABLE> flag " |
| 814 |
"and the file was moved to a different parent." |
| 815 |
msgstr "" |
| 816 |
|
| 817 |
#. type: SH |
| 818 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 819 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 820 |
#, no-wrap |
| 821 |
msgid "VERSIONS" |
| 822 |
msgstr "VERSIONS" |
| 823 |
|
| 824 |
#. type: Plain text |
| 825 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 826 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 827 |
#, fuzzy |
| 828 |
#| msgid "" |
| 829 |
#| "FreeBSD has a broadly similar pair of system calls in the form of " |
| 830 |
#| "B<getfh>() and B<openfh>()." |
| 831 |
msgid "" |
| 832 |
"FreeBSD has a broadly similar pair of system calls in the form of " |
| 833 |
"B<getfh>() and B<fhopen>()." |
| 834 |
msgstr "" |
| 835 |
"FreeBSD offre un couple d'appels système similaires : B<getfh>() et " |
| 836 |
"B<openfh>()." |
| 837 |
|
| 838 |
#. type: SH |
| 839 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 840 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 841 |
#, no-wrap |
| 842 |
msgid "STANDARDS" |
| 843 |
msgstr "NORMES" |
| 844 |
|
| 845 |
#. type: Plain text |
| 846 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 847 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 848 |
msgid "Linux." |
| 849 |
msgstr "Linux." |
| 850 |
|
| 851 |
#. type: SH |
| 852 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 853 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 854 |
#, no-wrap |
| 855 |
msgid "HISTORY" |
| 856 |
msgstr "HISTORIQUE" |
| 857 |
|
| 858 |
#. type: Plain text |
| 859 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 860 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 861 |
msgid "Linux 2.6.39, glibc 2.14." |
| 862 |
msgstr "Linux 2.6.39, glibc 2.14." |
| 863 |
|
| 864 |
#. type: SH |
| 865 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 866 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 867 |
#, no-wrap |
| 868 |
msgid "NOTES" |
| 869 |
msgstr "NOTES" |
| 870 |
|
| 871 |
#. type: Plain text |
| 872 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 873 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 874 |
msgid "" |
| 875 |
"A file handle can be generated in one process using B<name_to_handle_at>() " |
| 876 |
"and later used in a different process that calls B<open_by_handle_at>()." |
| 877 |
msgstr "" |
| 878 |
"Un indicateur de fichier peut être créé dans un processus au moyen de " |
| 879 |
"B<name_to_handle_at>() et utilisé plus tard dans un autre processus qui " |
| 880 |
"appelle B<open_by_handle_at>()." |
| 881 |
|
| 882 |
#. type: Plain text |
| 883 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 884 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 885 |
msgid "" |
| 886 |
"Some filesystem don't support the translation of pathnames to file handles, " |
| 887 |
"for example, I</proc>, I</sys>, and various network filesystems. Some " |
| 888 |
"filesystems support the translation of pathnames to file handles, but do not " |
| 889 |
"support using those file handles in B<open_by_handle_at>()." |
| 890 |
msgstr "" |
| 891 |
"Certains systèmes de fichiers ne permettent pas la transcription des chemins " |
| 892 |
"en indicateurs de fichier, par exemple, I</proc>, I</sys>, ainsi que divers " |
| 893 |
"systèmes de fichiers en réseaux. Certains systèmes de fichiers permettent la " |
| 894 |
"transcription des chemins en indicateurs de fichier, mais ne prennent pas en " |
| 895 |
"charge l'utilisation de ces indicateurs de fichier dans " |
| 896 |
"B<open_by_handle_at>()." |
| 897 |
|
| 898 |
#. type: Plain text |
| 899 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 900 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 901 |
msgid "" |
| 902 |
"A file handle may become invalid (\"stale\") if a file is deleted, or for " |
| 903 |
"other filesystem-specific reasons. Invalid handles are notified by an " |
| 904 |
"B<ESTALE> error from B<open_by_handle_at>()." |
| 905 |
msgstr "" |
| 906 |
"Un indicateur de fichier peut devenir non valable (« stale ») si un fichier " |
| 907 |
"est supprimé, ou pour une raison propre au système de fichiers. Les " |
| 908 |
"indicateurs non autorisés sont signalés par une erreur B<ESTALE> provenant " |
| 909 |
"de B<open_by_handle_at>(). " |
| 910 |
|
| 911 |
#. https://lwn.net/Articles/375888/ |
| 912 |
#. "Open by handle" - Jonathan Corbet, 2010-02-23 |
| 913 |
#. type: Plain text |
| 914 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 915 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 916 |
msgid "" |
| 917 |
"These system calls are designed for use by user-space file servers. For " |
| 918 |
"example, a user-space NFS server might generate a file handle and pass it to " |
| 919 |
"an NFS client. Later, when the client wants to open the file, it could pass " |
| 920 |
"the handle back to the server. This sort of functionality allows a user-" |
| 921 |
"space file server to operate in a stateless fashion with respect to the " |
| 922 |
"files it serves." |
| 923 |
msgstr "" |
| 924 |
"Ces appels systèmes sont conçus pour être utilisés par des serveurs de " |
| 925 |
"fichiers en espace utilisateur. Par exemple, un serveur NFS en espace " |
| 926 |
"utilisateur produit un indicateur de fichier et le transmet au client NFS. " |
| 927 |
"Plus tard, lorsque le client souhaite accéder au fichier, il peut renvoyer " |
| 928 |
"l'indicateur au serveur. Ce type de fonctionnalité permet à un serveur de " |
| 929 |
"fichiers en espace utilisateur d'opérer sans état vis à vis des fichiers " |
| 930 |
"qu'il délivre." |
| 931 |
|
| 932 |
#. commit bcda76524cd1fa32af748536f27f674a13e56700 |
| 933 |
#. type: Plain text |
| 934 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 935 |
#: opensuse-tumbleweed |
| 936 |
#, fuzzy |
| 937 |
#| msgid "" |
| 938 |
#| "If I<pathname> refers to a symbolic link and I<flags> does not specify " |
| 939 |
#| "B<AT_SYMLINK_FOLLOW>, then B<name_to_handle_at>() returns a handle for " |
| 940 |
#| "the link (rather than the file to which it refers). The process " |
| 941 |
#| "receiving the handle can later perform operations on the symbolic link by " |
| 942 |
#| "converting the handle to a file descriptor using B<open_by_handle_at>() " |
| 943 |
#| "with the B<O_PATH> flag, and then passing the file descriptor as the " |
| 944 |
#| "I<dirfd> argument in system calls such as B<readlinkat>(2) and " |
| 945 |
#| "B<fchownat>(2)." |
| 946 |
msgid "" |
| 947 |
"If I<path> refers to a symbolic link and I<flags> does not specify " |
| 948 |
"B<AT_SYMLINK_FOLLOW>, then B<name_to_handle_at>() returns a handle for the " |
| 949 |
"link (rather than the file to which it refers). The process receiving the " |
| 950 |
"handle can later perform operations on the symbolic link by converting the " |
| 951 |
"handle to a file descriptor using B<open_by_handle_at>() with the B<O_PATH> " |
| 952 |
"flag, and then passing the file descriptor as the I<dirfd> argument in " |
| 953 |
"system calls such as B<readlinkat>(2) and B<fchownat>(2)." |
| 954 |
msgstr "" |
| 955 |
"Si I<pathname> fait référence à un lien symbolique et si I<flags> ne précise " |
| 956 |
"pas B<AT_SYMLINK_FOLLOW>, alors B<name_to_handle_at>() renvoie un indicateur " |
| 957 |
"pour le lien (plutôt que pour le fichier vers lequel le lien pointe). Le " |
| 958 |
"processus recevant l'indicateur peut effectuer plus tard une opération sur " |
| 959 |
"ce lien symbolique, en convertissant l'indicateur en descripteur de fichier " |
| 960 |
"au moyen de B<open_by_handle_at>() utilisé avec l'argument B<O_PATH>, et en " |
| 961 |
"passant le descripteur de fichier en argument I<dirfd> d’appels système " |
| 962 |
"(tels que B<readlinkat>(2) et B<fchownat>(2)). " |
| 963 |
|
| 964 |
#. type: SS |
| 965 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 966 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 967 |
#, no-wrap |
| 968 |
msgid "Obtaining a persistent filesystem ID" |
| 969 |
msgstr "Obtenir un identifiant persistant de système de fichier" |
| 970 |
|
| 971 |
#. type: Plain text |
| 972 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 973 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 974 |
msgid "" |
| 975 |
"The mount IDs in I</proc/self/mountinfo> can be reused as filesystems are " |
| 976 |
"unmounted and mounted. Therefore, the mount ID returned by " |
| 977 |
"B<name_to_handle_at>() (in I<*mount_id>) should not be treated as a " |
| 978 |
"persistent identifier for the corresponding mounted filesystem. However, an " |
| 979 |
"application can use the information in the I<mountinfo> record that " |
| 980 |
"corresponds to the mount ID to derive a persistent identifier." |
| 981 |
msgstr "" |
| 982 |
"Les identifiants de montage dans I</proc/self/mountinfo> peuvent être " |
| 983 |
"réutilisés même lorsque les systèmes de fichiers sont démontés et remontés. " |
| 984 |
"Ainsi, l'identifiant de montage renvoyé par B<name_to_handle_at>() (dans " |
| 985 |
"I<*mount_id>) ne doit pas être considéré comme un identifiant persistant " |
| 986 |
"pour le système de fichiers considéré. Néanmoins, il est possible pour une " |
| 987 |
"application d'utiliser l'information fournie dans I<mountinfo> et " |
| 988 |
"correspondant à l'identifiant de montage pour en déduire un identifiant " |
| 989 |
"persistant." |
| 990 |
|
| 991 |
#. e.g., http://stackoverflow.com/questions/6748429/using-libblkid-to-find-uuid-of-a-partition |
| 992 |
#. type: Plain text |
| 993 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 994 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 995 |
msgid "" |
| 996 |
"For example, one can use the device name in the fifth field of the " |
| 997 |
"I<mountinfo> record to search for the corresponding device UUID via the " |
| 998 |
"symbolic links in I</dev/disks/by-uuid>. (A more comfortable way of " |
| 999 |
"obtaining the UUID is to use the B<libblkid>(3) library.) That process can " |
| 1000 |
"then be reversed, using the UUID to look up the device name, and then " |
| 1001 |
"obtaining the corresponding mount point, in order to produce the I<mount_fd> " |
| 1002 |
"argument used by B<open_by_handle_at>()." |
| 1003 |
msgstr "" |
| 1004 |
"Par exemple, on peut utiliser le nom de périphérique présent dans le " |
| 1005 |
"cinquième champ de I<mountinfo> pour retrouver l'UUID du périphérique " |
| 1006 |
"correspondant au moyen des liens symboliques dans I</dev/disks/by-uuid>. (Un " |
| 1007 |
"moyen plus simple d'obtenir cet UUID consiste à utiliser la bibliothèque " |
| 1008 |
"B<libblkid>(3)). Cette façon de procéder peut être inversée, en utilisant " |
| 1009 |
"l'UUID pour retrouver le nom du périphérique, et ainsi obtenir le point de " |
| 1010 |
"montage correspondant, et enfin construire l'argument de I<mount_fd> utile à " |
| 1011 |
"B<open_by_handle_at>()." |
| 1012 |
|
| 1013 |
#. type: SH |
| 1014 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1015 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1016 |
#, no-wrap |
| 1017 |
msgid "EXAMPLES" |
| 1018 |
msgstr "EXEMPLES" |
| 1019 |
|
| 1020 |
#. type: Plain text |
| 1021 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1022 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1023 |
msgid "" |
| 1024 |
"The two programs below demonstrate the use of B<name_to_handle_at>() and " |
| 1025 |
"B<open_by_handle_at>(). The first program (I<t_name_to_handle_at.c>) uses " |
| 1026 |
"B<name_to_handle_at>() to obtain the file handle and mount ID for the file " |
| 1027 |
"specified in its command-line argument; the handle and mount ID are written " |
| 1028 |
"to standard output." |
| 1029 |
msgstr "" |
| 1030 |
"Les deux programmes suivants illustrent l'utilisation de " |
| 1031 |
"B<name_to_handle_at>() et de B<open_by_handle_at>(). Le premier programme " |
| 1032 |
"(I<t_name_to_handle_at.c>) utilise B<name_to_handle_at>() pour récupérer " |
| 1033 |
"l'indicateur de fichier et l'identifiant de montage du fichier indiqué dans " |
| 1034 |
"les arguments en ligne de commande ; l'indicateur et l'identifiant de " |
| 1035 |
"montage sont écrits sur la sortie standard." |
| 1036 |
|
| 1037 |
#. type: Plain text |
| 1038 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1039 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1040 |
msgid "" |
| 1041 |
"The second program (I<t_open_by_handle_at.c>) reads a mount ID and file " |
| 1042 |
"handle from standard input. The program then employs " |
| 1043 |
"B<open_by_handle_at>() to open the file using that handle. If an optional " |
| 1044 |
"command-line argument is supplied, then the I<mount_fd> argument for " |
| 1045 |
"B<open_by_handle_at>() is obtained by opening the directory named in that " |
| 1046 |
"argument. Otherwise, I<mount_fd> is obtained by scanning I</proc/self/" |
| 1047 |
"mountinfo> to find a record whose mount ID matches the mount ID read from " |
| 1048 |
"standard input, and the mount directory specified in that record is opened. " |
| 1049 |
"(These programs do not deal with the fact that mount IDs are not persistent.)" |
| 1050 |
msgstr "" |
| 1051 |
"Le second programme (I<t_open_by_handle_at.c>) lit un identifiant de montage " |
| 1052 |
"et un indicateur de fichier depuis l'entrée standard. Le programme utilise " |
| 1053 |
"ensuite B<open_by_handle_at>() pour lire le fichier au moyen de cet " |
| 1054 |
"indicateur. Si un argument optionnel est fourni dans la ligne de commande, " |
| 1055 |
"alors l'argument I<mount_fd> de B<open_by_handle_at>() est obtenu en ouvrant " |
| 1056 |
"le répertoire précisé en argument. Sinon, I<mount_fd> est obtenu en " |
| 1057 |
"parcourant I</proc/self/mountinfo> à la recherche d'un identifiant de " |
| 1058 |
"montage correspondant à celui fourni via l'entrée standard, et le répertoire " |
| 1059 |
"monté qui a été trouvé est ouvert. (Ces programmes ne tiennent pas compte du " |
| 1060 |
"fait que les identifiants de montage ne sont pas persistants.)" |
| 1061 |
|
| 1062 |
#. type: Plain text |
| 1063 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1064 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1065 |
msgid "The following shell session demonstrates the use of these two programs:" |
| 1066 |
msgstr "" |
| 1067 |
"La session shell suivante montre des exemples d'utilisation de ces deux " |
| 1068 |
"programmes :" |
| 1069 |
|
| 1070 |
#. type: Plain text |
| 1071 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 1072 |
#: opensuse-tumbleweed |
| 1073 |
#, fuzzy, no-wrap |
| 1074 |
#| msgid "" |
| 1075 |
#| "$ B<echo \\[aq]Can you please think about it?\\[aq] E<gt> cecilia.txt>\n" |
| 1076 |
#| "$ B<./t_name_to_handle_at cecilia.txt E<gt> fh>\n" |
| 1077 |
#| "$ B<./t_open_by_handle_at E<lt> fh>\n" |
| 1078 |
#| "open_by_handle_at: Operation not permitted\n" |
| 1079 |
#| "$ B<sudo ./t_open_by_handle_at E<lt> fh> # Need CAP_SYS_ADMIN\n" |
| 1080 |
#| "Read 31 bytes\n" |
| 1081 |
#| "$ B<rm cecilia.txt>\n" |
| 1082 |
msgid "" |
| 1083 |
"$B< echo \\[aq]Can you please think about it?\\[aq] E<gt> cecilia.txt>;\n" |
| 1084 |
"$B< ./t_name_to_handle_at cecilia.txt E<gt> fh>;\n" |
| 1085 |
"$B< ./t_open_by_handle_at E<lt> fh>;\n" |
| 1086 |
"open_by_handle_at: Operation not permitted\n" |
| 1087 |
"$B< sudo ./t_open_by_handle_at E<lt> fh>; # Need CAP_SYS_ADMIN\n" |
| 1088 |
"Read 31 bytes\n" |
| 1089 |
"$B< rm cecilia.txt>;\n" |
| 1090 |
msgstr "" |
| 1091 |
"$ B<echo \\[aq]Can you please think about it?\\[aq] E<gt> cecilia.txt>\n" |
| 1092 |
"$ B<./t_name_to_handle_at cecilia.txt E<gt> fh>\n" |
| 1093 |
"$ B<./t_open_by_handle_at E<lt> fh>\n" |
| 1094 |
"open_by_handle_at: Operation not permitted\n" |
| 1095 |
"$ B<sudo ./t_open_by_handle_at E<lt> fh> # Nécessite CAP_SYS_ADMIN\n" |
| 1096 |
"Read 31 bytes\n" |
| 1097 |
"$ B<rm cecilia.txt>\n" |
| 1098 |
|
| 1099 |
#. Christoph Hellwig: That's why the file handles contain a generation |
| 1100 |
#. counter that gets incremented in this case. |
| 1101 |
#. type: Plain text |
| 1102 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1103 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1104 |
msgid "" |
| 1105 |
"Now we delete and (quickly) re-create the file so that it has the same " |
| 1106 |
"content and (by chance) the same inode. Nevertheless, " |
| 1107 |
"B<open_by_handle_at>() recognizes that the original file referred to by the " |
| 1108 |
"file handle no longer exists." |
| 1109 |
msgstr "" |
| 1110 |
"A ce stade, on supprime et recrée (rapidement) le fichier, de sorte qu'il " |
| 1111 |
"ait le même contenu et (avec un peu de chance) le même inœud. Cependant, " |
| 1112 |
"B<open_by_handle_at>() s'aperçoit que le fichier original auquel " |
| 1113 |
"l'indicateur fait référence n'existe plus." |
| 1114 |
|
| 1115 |
#. type: Plain text |
| 1116 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 1117 |
#: opensuse-tumbleweed |
| 1118 |
#, fuzzy, no-wrap |
| 1119 |
#| msgid "" |
| 1120 |
#| "$ B<stat --printf=\"%i\\en\" cecilia.txt> # Display inode number\n" |
| 1121 |
#| "4072121\n" |
| 1122 |
#| "$ B<rm cecilia.txt>\n" |
| 1123 |
#| "$ B<echo \\[aq]Can you please think about it?\\[aq] E<gt> cecilia.txt>\n" |
| 1124 |
#| "$ B<stat --printf=\"%i\\en\" cecilia.txt> # Check inode number\n" |
| 1125 |
#| "4072121\n" |
| 1126 |
#| "$ B<sudo ./t_open_by_handle_at E<lt> fh>\n" |
| 1127 |
#| "open_by_handle_at: Stale NFS file handle\n" |
| 1128 |
msgid "" |
| 1129 |
"$B< stat --printf=\\[dq]%i\\[rs]n\\[dq] cecilia.txt>; # Display inode number\n" |
| 1130 |
"4072121\n" |
| 1131 |
"$B< rm cecilia.txt>;\n" |
| 1132 |
"$B< echo \\[aq]Can you please think about it?\\[aq] E<gt> cecilia.txt>;\n" |
| 1133 |
"$B< stat --printf=\\[dq]%i\\[rs]n\\[dq] cecilia.txt>; # Check inode number\n" |
| 1134 |
"4072121\n" |
| 1135 |
"$B< sudo ./t_open_by_handle_at E<lt> fh>;\n" |
| 1136 |
"open_by_handle_at: Stale NFS file handle\n" |
| 1137 |
msgstr "" |
| 1138 |
"$ B<stat --printf=\"%i\\en\" cecilia.txt> # Affiche le numéro d'inœud\n" |
| 1139 |
"4072121\n" |
| 1140 |
"$ B<rm cecilia.txt>\n" |
| 1141 |
"$ B<echo \\[aq]Can you please think about it?\\[aq] E<gt> cecilia.txt>\n" |
| 1142 |
"$ B<stat --printf=\"%i\\en\" cecilia.txt> # Vérifie le numéro d'inœud\n" |
| 1143 |
"4072121\n" |
| 1144 |
"$ B<sudo ./t_open_by_handle_at E<lt> fh>\n" |
| 1145 |
"open_by_handle_at: Stale NFS file handle\n" |
| 1146 |
|
| 1147 |
#. type: SS |
| 1148 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1149 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1150 |
#, no-wrap |
| 1151 |
msgid "Program source: t_name_to_handle_at.c" |
| 1152 |
msgstr "Source du programme : t_name_to_handle_at.c" |
| 1153 |
|
| 1154 |
#. type: Plain text |
| 1155 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 1156 |
#: opensuse-tumbleweed |
| 1157 |
#, fuzzy, no-wrap |
| 1158 |
#| msgid "" |
| 1159 |
#| "#define _GNU_SOURCE\n" |
| 1160 |
#| "#include E<lt>err.hE<gt>\n" |
| 1161 |
#| "#include E<lt>errno.hE<gt>\n" |
| 1162 |
#| "#include E<lt>fcntl.hE<gt>\n" |
| 1163 |
#| "#include E<lt>stdio.hE<gt>\n" |
| 1164 |
#| "#include E<lt>stdlib.hE<gt>\n" |
| 1165 |
#| "\\&\n" |
| 1166 |
#| "int\n" |
| 1167 |
#| "main(int argc, char *argv[])\n" |
| 1168 |
#| "{\n" |
| 1169 |
#| " int mount_id, fhsize, flags, dirfd;\n" |
| 1170 |
#| " char *pathname;\n" |
| 1171 |
#| " struct file_handle *fhp;\n" |
| 1172 |
#| "\\&\n" |
| 1173 |
#| " if (argc != 2) {\n" |
| 1174 |
#| " fprintf(stderr, \"Usage: %s pathname\\en\", argv[0]);\n" |
| 1175 |
#| " exit(EXIT_FAILURE);\n" |
| 1176 |
#| " }\n" |
| 1177 |
#| "\\&\n" |
| 1178 |
#| " pathname = argv[1];\n" |
| 1179 |
#| "\\&\n" |
| 1180 |
#| " /* Allocate file_handle structure. */\n" |
| 1181 |
#| "\\&\n" |
| 1182 |
#| " fhsize = sizeof(*fhp);\n" |
| 1183 |
#| " fhp = malloc(fhsize);\n" |
| 1184 |
#| " if (fhp == NULL)\n" |
| 1185 |
#| " err(EXIT_FAILURE, \"malloc\");\n" |
| 1186 |
#| "\\&\n" |
| 1187 |
#| " /* Make an initial call to name_to_handle_at() to discover\n" |
| 1188 |
#| " the size required for file handle. */\n" |
| 1189 |
#| "\\&\n" |
| 1190 |
#| " dirfd = AT_FDCWD; /* For name_to_handle_at() calls */\n" |
| 1191 |
#| " flags = 0; /* For name_to_handle_at() calls */\n" |
| 1192 |
#| " fhp-E<gt>handle_bytes = 0;\n" |
| 1193 |
#| " if (name_to_handle_at(dirfd, pathname, fhp,\n" |
| 1194 |
#| " &mount_id, flags) != -1\n" |
| 1195 |
#| " || errno != EOVERFLOW)\n" |
| 1196 |
#| " {\n" |
| 1197 |
#| " fprintf(stderr, \"Unexpected result from name_to_handle_at()\\en\");\n" |
| 1198 |
#| " exit(EXIT_FAILURE);\n" |
| 1199 |
#| " }\n" |
| 1200 |
#| "\\&\n" |
| 1201 |
#| " /* Reallocate file_handle structure with correct size. */\n" |
| 1202 |
#| "\\&\n" |
| 1203 |
#| " fhsize = sizeof(*fhp) + fhp-E<gt>handle_bytes;\n" |
| 1204 |
#| " fhp = realloc(fhp, fhsize); /* Copies fhp-E<gt>handle_bytes */\n" |
| 1205 |
#| " if (fhp == NULL)\n" |
| 1206 |
#| " err(EXIT_FAILURE, \"realloc\");\n" |
| 1207 |
#| "\\&\n" |
| 1208 |
#| " /* Get file handle from pathname supplied on command line. */\n" |
| 1209 |
#| "\\&\n" |
| 1210 |
#| " if (name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags) == -1)\n" |
| 1211 |
#| " err(EXIT_FAILURE, \"name_to_handle_at\");\n" |
| 1212 |
#| "\\&\n" |
| 1213 |
#| " /* Write mount ID, file handle size, and file handle to stdout,\n" |
| 1214 |
#| " for later reuse by t_open_by_handle_at.c. */\n" |
| 1215 |
#| "\\&\n" |
| 1216 |
#| " printf(\"%d\\en\", mount_id);\n" |
| 1217 |
#| " printf(\"%u %d \", fhp-E<gt>handle_bytes, fhp-E<gt>handle_type);\n" |
| 1218 |
#| " for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n" |
| 1219 |
#| " printf(\" %02x\", fhp-E<gt>f_handle[j]);\n" |
| 1220 |
#| " printf(\"\\en\");\n" |
| 1221 |
#| "\\&\n" |
| 1222 |
#| " exit(EXIT_SUCCESS);\n" |
| 1223 |
#| "}\n" |
| 1224 |
msgid "" |
| 1225 |
"#define _GNU_SOURCE\n" |
| 1226 |
"#include E<lt>err.hE<gt>\n" |
| 1227 |
"#include E<lt>errno.hE<gt>\n" |
| 1228 |
"#include E<lt>fcntl.hE<gt>\n" |
| 1229 |
"#include E<lt>stdio.hE<gt>\n" |
| 1230 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1231 |
"\\&\n" |
| 1232 |
"int\n" |
| 1233 |
"main(int argc, char *argv[])\n" |
| 1234 |
"{\n" |
| 1235 |
" int mount_id, fhsize, flags, dirfd;\n" |
| 1236 |
" char *path;\n" |
| 1237 |
" struct file_handle *fhp;\n" |
| 1238 |
"\\&\n" |
| 1239 |
" if (argc != 2) {\n" |
| 1240 |
" fprintf(stderr, \"Usage: %s path\\[rs]n\", argv[0]);\n" |
| 1241 |
" exit(EXIT_FAILURE);\n" |
| 1242 |
" }\n" |
| 1243 |
"\\&\n" |
| 1244 |
" path = argv[1];\n" |
| 1245 |
"\\&\n" |
| 1246 |
" /* Allocate file_handle structure. */\n" |
| 1247 |
"\\&\n" |
| 1248 |
" fhsize = sizeof(*fhp);\n" |
| 1249 |
" fhp = malloc(fhsize);\n" |
| 1250 |
" if (fhp == NULL)\n" |
| 1251 |
" err(EXIT_FAILURE, \"malloc\");\n" |
| 1252 |
"\\&\n" |
| 1253 |
" /* Make an initial call to name_to_handle_at() to discover\n" |
| 1254 |
" the size required for file handle. */\n" |
| 1255 |
"\\&\n" |
| 1256 |
" dirfd = AT_FDCWD; /* For name_to_handle_at() calls */\n" |
| 1257 |
" flags = 0; /* For name_to_handle_at() calls */\n" |
| 1258 |
" fhp-E<gt>handle_bytes = 0;\n" |
| 1259 |
" if (name_to_handle_at(dirfd, path, fhp, &mount_id, flags) != -1\n" |
| 1260 |
" || errno != EOVERFLOW)\n" |
| 1261 |
" {\n" |
| 1262 |
" fprintf(stderr, \"Unexpected result from name_to_handle_at()\\[rs]n\");\n" |
| 1263 |
" exit(EXIT_FAILURE);\n" |
| 1264 |
" }\n" |
| 1265 |
"\\&\n" |
| 1266 |
" /* Reallocate file_handle structure with correct size. */\n" |
| 1267 |
"\\&\n" |
| 1268 |
" fhsize = sizeof(*fhp) + fhp-E<gt>handle_bytes;\n" |
| 1269 |
" fhp = realloc(fhp, fhsize); /* Copies fhp-E<gt>handle_bytes */\n" |
| 1270 |
" if (fhp == NULL)\n" |
| 1271 |
" err(EXIT_FAILURE, \"realloc\");\n" |
| 1272 |
"\\&\n" |
| 1273 |
" /* Get file handle from pathname supplied on command line. */\n" |
| 1274 |
"\\&\n" |
| 1275 |
" if (name_to_handle_at(dirfd, path, fhp, &mount_id, flags) == -1)\n" |
| 1276 |
" err(EXIT_FAILURE, \"name_to_handle_at\");\n" |
| 1277 |
"\\&\n" |
| 1278 |
" /* Write mount ID, file handle size, and file handle to stdout,\n" |
| 1279 |
" for later reuse by t_open_by_handle_at.c. */\n" |
| 1280 |
"\\&\n" |
| 1281 |
" printf(\"%d\\[rs]n\", mount_id);\n" |
| 1282 |
" printf(\"%u %d \", fhp-E<gt>handle_bytes, fhp-E<gt>handle_type);\n" |
| 1283 |
" for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n" |
| 1284 |
" printf(\" %02x\", fhp-E<gt>f_handle[j]);\n" |
| 1285 |
" printf(\"\\[rs]n\");\n" |
| 1286 |
"\\&\n" |
| 1287 |
" exit(EXIT_SUCCESS);\n" |
| 1288 |
"}\n" |
| 1289 |
msgstr "" |
| 1290 |
"#define _GNU_SOURCE\n" |
| 1291 |
"#include E<lt>err.hE<gt>\n" |
| 1292 |
"#include E<lt>errno.hE<gt>\n" |
| 1293 |
"#include E<lt>fcntl.hE<gt>\n" |
| 1294 |
"#include E<lt>stdio.hE<gt>\n" |
| 1295 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1296 |
"\\&\n" |
| 1297 |
"int\n" |
| 1298 |
"main(int argc, char *argv[])\n" |
| 1299 |
"{\n" |
| 1300 |
" int mount_id, fhsize, flags, dirfd;\n" |
| 1301 |
" char *pathname;\n" |
| 1302 |
" struct file_handle *fhp;\n" |
| 1303 |
"\\&\n" |
| 1304 |
" if (argc != 2) {\n" |
| 1305 |
" fprintf(stderr, \"Utilisation : %s pathname\\en\", argv[0]);\n" |
| 1306 |
" exit(EXIT_FAILURE);\n" |
| 1307 |
" }\n" |
| 1308 |
"\\&\n" |
| 1309 |
" pathname = argv[1];\n" |
| 1310 |
"\\&\n" |
| 1311 |
" /* Allocate file_handle structure. */\n" |
| 1312 |
"\\&\n" |
| 1313 |
" fhsize = sizeof(*fhp);\n" |
| 1314 |
" fhp = malloc(fhsize);\n" |
| 1315 |
" if (fhp == NULL)\n" |
| 1316 |
" err(EXIT_FAILURE, \"malloc\");\n" |
| 1317 |
"\\&\n" |
| 1318 |
" /* Effectue un appel initial à name_to_handle_at() afin de connaître\n" |
| 1319 |
" la taille nécessaire à l'indicateur de fichier. */\n" |
| 1320 |
"\\&\n" |
| 1321 |
" dirfd = AT_FDCWD; /* Pour les appels à name_to_handle_at() */\n" |
| 1322 |
" flags = 0; /* Pour les appels à name_to_handle_at() */\n" |
| 1323 |
" fhp-E<gt>handle_bytes = 0;\n" |
| 1324 |
" if (name_to_handle_at(dirfd, pathname, fhp,\n" |
| 1325 |
" &mount_id, flags) != -1\n" |
| 1326 |
" || errno != EOVERFLOW)\n" |
| 1327 |
" {\n" |
| 1328 |
" fprintf(stderr, \"Résultat inattendu de name_to_handle_at()\\en\");\n" |
| 1329 |
" exit(EXIT_FAILURE);\n" |
| 1330 |
" }\n" |
| 1331 |
"\\&\n" |
| 1332 |
" /* Ré-alloue la structure file_handle avec la bonne taille. */\n" |
| 1333 |
"\\&\n" |
| 1334 |
" fhsize = sizeof(*fhp) + fhp-E<gt>handle_bytes;\n" |
| 1335 |
" fhp = realloc(fhp, fhsize); /* Copies fhp-E<gt>handle_bytes */\n" |
| 1336 |
" if (fhp == NULL)\n" |
| 1337 |
" err(EXIT_FAILURE, \"realloc\");\n" |
| 1338 |
"\\&\n" |
| 1339 |
" /* Retrouve l'indicateur de fichier à partir du\n" |
| 1340 |
" chemin fourni dans la ligne de commande. */\n" |
| 1341 |
"\\&\n" |
| 1342 |
" if (name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags) == -1)\n" |
| 1343 |
" err(EXIT_FAILURE, \"name_to_handle_at\");\n" |
| 1344 |
"\\&\n" |
| 1345 |
" /* Écrit l'identifiant de montage, la taille de l'indicateur et\n" |
| 1346 |
" l'indicateur vers la sortie standard pour être utilisés\n" |
| 1347 |
" plus tard par t_open_by_handle_at.c. */\n" |
| 1348 |
"\\&\n" |
| 1349 |
" printf(\"%d\\en\", mount_id);\n" |
| 1350 |
" printf(\"%u %d \", fhp-E<gt>handle_bytes, fhp-E<gt>handle_type);\n" |
| 1351 |
" for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n" |
| 1352 |
" printf(\" %02x\", fhp-E<gt>f_handle[j]);\n" |
| 1353 |
" printf(\"\\en\");\n" |
| 1354 |
"\\&\n" |
| 1355 |
" exit(EXIT_SUCCESS);\n" |
| 1356 |
"}\n" |
| 1357 |
|
| 1358 |
#. SRC END |
| 1359 |
#. type: SS |
| 1360 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1361 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1362 |
#, no-wrap |
| 1363 |
msgid "Program source: t_open_by_handle_at.c" |
| 1364 |
msgstr "Source du programme : t_open_by_handle_at.c" |
| 1365 |
|
| 1366 |
#. type: Plain text |
| 1367 |
#: archlinux debian-unstable opensuse-leap-16-1 opensuse-tumbleweed |
| 1368 |
#, fuzzy, no-wrap |
| 1369 |
#| msgid "" |
| 1370 |
#| "#define _GNU_SOURCE\n" |
| 1371 |
#| "#include E<lt>err.hE<gt>\n" |
| 1372 |
#| "#include E<lt>fcntl.hE<gt>\n" |
| 1373 |
#| "#include E<lt>limits.hE<gt>\n" |
| 1374 |
#| "#include E<lt>stdio.hE<gt>\n" |
| 1375 |
#| "#include E<lt>stdlib.hE<gt>\n" |
| 1376 |
#| "#include E<lt>string.hE<gt>\n" |
| 1377 |
#| "#include E<lt>unistd.hE<gt>\n" |
| 1378 |
#| "\\&\n" |
| 1379 |
#| "/* Scan /proc/self/mountinfo to find the line whose mount ID matches\n" |
| 1380 |
#| " \\[aq]mount_id\\[aq]. (An easier way to do this is to install and use the\n" |
| 1381 |
#| " \\[aq]libmount\\[aq] library provided by the \\[aq]util-linux\\[aq] project.)\n" |
| 1382 |
#| " Open the corresponding mount path and return the resulting file\n" |
| 1383 |
#| " descriptor. */\n" |
| 1384 |
#| "\\&\n" |
| 1385 |
#| "static int\n" |
| 1386 |
#| "open_mount_path_by_id(int mount_id)\n" |
| 1387 |
#| "{\n" |
| 1388 |
#| " int mi_mount_id, found;\n" |
| 1389 |
#| " char mount_path[PATH_MAX];\n" |
| 1390 |
#| " char *linep;\n" |
| 1391 |
#| " FILE *fp;\n" |
| 1392 |
#| " size_t lsize;\n" |
| 1393 |
#| " ssize_t nread;\n" |
| 1394 |
#| "\\&\n" |
| 1395 |
#| " fp = fopen(\"/proc/self/mountinfo\", \"r\");\n" |
| 1396 |
#| " if (fp == NULL)\n" |
| 1397 |
#| " err(EXIT_FAILURE, \"fopen\");\n" |
| 1398 |
#| "\\&\n" |
| 1399 |
#| " found = 0;\n" |
| 1400 |
#| " linep = NULL;\n" |
| 1401 |
#| " while (!found) {\n" |
| 1402 |
#| " nread = getline(&linep, &lsize, fp);\n" |
| 1403 |
#| " if (nread == -1)\n" |
| 1404 |
#| " break;\n" |
| 1405 |
#| "\\&\n" |
| 1406 |
#| " nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n" |
| 1407 |
#| " &mi_mount_id, mount_path);\n" |
| 1408 |
#| " if (nread != 2) {\n" |
| 1409 |
#| " fprintf(stderr, \"Bad sscanf()\\en\");\n" |
| 1410 |
#| " exit(EXIT_FAILURE);\n" |
| 1411 |
#| " }\n" |
| 1412 |
#| "\\&\n" |
| 1413 |
#| " if (mi_mount_id == mount_id)\n" |
| 1414 |
#| " found = 1;\n" |
| 1415 |
#| " }\n" |
| 1416 |
#| " free(linep);\n" |
| 1417 |
#| "\\&\n" |
| 1418 |
#| " fclose(fp);\n" |
| 1419 |
#| "\\&\n" |
| 1420 |
#| " if (!found) {\n" |
| 1421 |
#| " fprintf(stderr, \"Could not find mount point\\en\");\n" |
| 1422 |
#| " exit(EXIT_FAILURE);\n" |
| 1423 |
#| " }\n" |
| 1424 |
#| "\\&\n" |
| 1425 |
#| " return open(mount_path, O_RDONLY);\n" |
| 1426 |
#| "}\n" |
| 1427 |
#| "\\&\n" |
| 1428 |
#| "int\n" |
| 1429 |
#| "main(int argc, char *argv[])\n" |
| 1430 |
#| "{\n" |
| 1431 |
#| " int mount_id, fd, mount_fd, handle_bytes;\n" |
| 1432 |
#| " char buf[1000];\n" |
| 1433 |
#| "#define LINE_SIZE 100\n" |
| 1434 |
#| " char line1[LINE_SIZE], line2[LINE_SIZE];\n" |
| 1435 |
#| " char *nextp;\n" |
| 1436 |
#| " ssize_t nread;\n" |
| 1437 |
#| " struct file_handle *fhp;\n" |
| 1438 |
#| "\\&\n" |
| 1439 |
#| " if ((argc E<gt> 1 && strcmp(argv[1], \"--help\") == 0) || argc E<gt> 2) {\n" |
| 1440 |
#| " fprintf(stderr, \"Usage: %s [mount-path]\\en\", argv[0]);\n" |
| 1441 |
#| " exit(EXIT_FAILURE);\n" |
| 1442 |
#| " }\n" |
| 1443 |
#| "\\&\n" |
| 1444 |
#| " /* Standard input contains mount ID and file handle information:\n" |
| 1445 |
#| "\\&\n" |
| 1446 |
#| " Line 1: E<lt>mount_idE<gt>\n" |
| 1447 |
#| " Line 2: E<lt>handle_bytesE<gt> E<lt>handle_typeE<gt> E<lt>bytes of handle in hexE<gt>\n" |
| 1448 |
#| " */\n" |
| 1449 |
#| "\\&\n" |
| 1450 |
#| " if (fgets(line1, sizeof(line1), stdin) == NULL ||\n" |
| 1451 |
#| " fgets(line2, sizeof(line2), stdin) == NULL)\n" |
| 1452 |
#| " {\n" |
| 1453 |
#| " fprintf(stderr, \"Missing mount_id / file handle\\en\");\n" |
| 1454 |
#| " exit(EXIT_FAILURE);\n" |
| 1455 |
#| " }\n" |
| 1456 |
#| "\\&\n" |
| 1457 |
#| " mount_id = atoi(line1);\n" |
| 1458 |
#| "\\&\n" |
| 1459 |
#| " handle_bytes = strtoul(line2, &nextp, 0);\n" |
| 1460 |
#| "\\&\n" |
| 1461 |
#| " /* Given handle_bytes, we can now allocate file_handle structure. */\n" |
| 1462 |
#| "\\&\n" |
| 1463 |
#| " fhp = malloc(sizeof(*fhp) + handle_bytes);\n" |
| 1464 |
#| " if (fhp == NULL)\n" |
| 1465 |
#| " err(EXIT_FAILURE, \"malloc\");\n" |
| 1466 |
#| "\\&\n" |
| 1467 |
#| " fhp-E<gt>handle_bytes = handle_bytes;\n" |
| 1468 |
#| "\\&\n" |
| 1469 |
#| " fhp-E<gt>handle_type = strtoul(nextp, &nextp, 0);\n" |
| 1470 |
#| "\\&\n" |
| 1471 |
#| " for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n" |
| 1472 |
#| " fhp-E<gt>f_handle[j] = strtoul(nextp, &nextp, 16);\n" |
| 1473 |
#| "\\&\n" |
| 1474 |
#| " /* Obtain file descriptor for mount point, either by opening\n" |
| 1475 |
#| " the pathname specified on the command line, or by scanning\n" |
| 1476 |
#| " /proc/self/mounts to find a mount that matches the \\[aq]mount_id\\[aq]\n" |
| 1477 |
#| " that we received from stdin. */\n" |
| 1478 |
#| "\\&\n" |
| 1479 |
#| " if (argc E<gt> 1)\n" |
| 1480 |
#| " mount_fd = open(argv[1], O_RDONLY);\n" |
| 1481 |
#| " else\n" |
| 1482 |
#| " mount_fd = open_mount_path_by_id(mount_id);\n" |
| 1483 |
#| "\\&\n" |
| 1484 |
#| " if (mount_fd == -1)\n" |
| 1485 |
#| " err(EXIT_FAILURE, \"opening mount fd\");\n" |
| 1486 |
#| "\\&\n" |
| 1487 |
#| " /* Open file using handle and mount point. */\n" |
| 1488 |
#| "\\&\n" |
| 1489 |
#| " fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n" |
| 1490 |
#| " if (fd == -1)\n" |
| 1491 |
#| " err(EXIT_FAILURE, \"open_by_handle_at\");\n" |
| 1492 |
#| "\\&\n" |
| 1493 |
#| " /* Try reading a few bytes from the file. */\n" |
| 1494 |
#| "\\&\n" |
| 1495 |
#| " nread = read(fd, buf, sizeof(buf));\n" |
| 1496 |
#| " if (nread == -1)\n" |
| 1497 |
#| " err(EXIT_FAILURE, \"read\");\n" |
| 1498 |
#| "\\&\n" |
| 1499 |
#| " printf(\"Read %zd bytes\\en\", nread);\n" |
| 1500 |
#| "\\&\n" |
| 1501 |
#| " exit(EXIT_SUCCESS);\n" |
| 1502 |
#| "}\n" |
| 1503 |
msgid "" |
| 1504 |
"#define _GNU_SOURCE\n" |
| 1505 |
"#include E<lt>err.hE<gt>\n" |
| 1506 |
"#include E<lt>fcntl.hE<gt>\n" |
| 1507 |
"#include E<lt>limits.hE<gt>\n" |
| 1508 |
"#include E<lt>stdio.hE<gt>\n" |
| 1509 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1510 |
"#include E<lt>string.hE<gt>\n" |
| 1511 |
"#include E<lt>sys/types.hE<gt>\n" |
| 1512 |
"#include E<lt>unistd.hE<gt>\n" |
| 1513 |
"\\&\n" |
| 1514 |
"#define streq(...) (strcmp(__VA_ARGS__) == 0)\n" |
| 1515 |
"\\&\n" |
| 1516 |
"/* Scan /proc/self/mountinfo to find the line whose mount ID matches\n" |
| 1517 |
" \\[aq]mount_id\\[aq]. (An easier way to do this is to install and use the\n" |
| 1518 |
" \\[aq]libmount\\[aq] library provided by the \\[aq]util-linux\\[aq] project.)\n" |
| 1519 |
" Open the corresponding mount path and return the resulting file\n" |
| 1520 |
" descriptor. */\n" |
| 1521 |
"\\&\n" |
| 1522 |
"static int\n" |
| 1523 |
"open_mount_path_by_id(int mount_id)\n" |
| 1524 |
"{\n" |
| 1525 |
" int mi_mount_id, found;\n" |
| 1526 |
" char mount_path[PATH_MAX];\n" |
| 1527 |
" char *linep;\n" |
| 1528 |
" FILE *fp;\n" |
| 1529 |
" size_t lsize;\n" |
| 1530 |
" ssize_t nread;\n" |
| 1531 |
"\\&\n" |
| 1532 |
" fp = fopen(\"/proc/self/mountinfo\", \"r\");\n" |
| 1533 |
" if (fp == NULL)\n" |
| 1534 |
" err(EXIT_FAILURE, \"fopen\");\n" |
| 1535 |
"\\&\n" |
| 1536 |
" found = 0;\n" |
| 1537 |
" linep = NULL;\n" |
| 1538 |
" while (!found) {\n" |
| 1539 |
" nread = getline(&linep, &lsize, fp);\n" |
| 1540 |
" if (nread == -1)\n" |
| 1541 |
" break;\n" |
| 1542 |
"\\&\n" |
| 1543 |
" nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n" |
| 1544 |
" &mi_mount_id, mount_path);\n" |
| 1545 |
" if (nread != 2) {\n" |
| 1546 |
" fprintf(stderr, \"Bad sscanf()\\[rs]n\");\n" |
| 1547 |
" exit(EXIT_FAILURE);\n" |
| 1548 |
" }\n" |
| 1549 |
"\\&\n" |
| 1550 |
" if (mi_mount_id == mount_id)\n" |
| 1551 |
" found = 1;\n" |
| 1552 |
" }\n" |
| 1553 |
" free(linep);\n" |
| 1554 |
"\\&\n" |
| 1555 |
" fclose(fp);\n" |
| 1556 |
"\\&\n" |
| 1557 |
" if (!found) {\n" |
| 1558 |
" fprintf(stderr, \"Could not find mount point\\[rs]n\");\n" |
| 1559 |
" exit(EXIT_FAILURE);\n" |
| 1560 |
" }\n" |
| 1561 |
"\\&\n" |
| 1562 |
" return open(mount_path, O_RDONLY);\n" |
| 1563 |
"}\n" |
| 1564 |
"\\&\n" |
| 1565 |
"int\n" |
| 1566 |
"main(int argc, char *argv[])\n" |
| 1567 |
"{\n" |
| 1568 |
" int mount_id, fd, mount_fd, handle_bytes;\n" |
| 1569 |
" char buf[1000];\n" |
| 1570 |
"#define LINE_SIZE 100\n" |
| 1571 |
" char line1[LINE_SIZE], line2[LINE_SIZE];\n" |
| 1572 |
" char *nextp;\n" |
| 1573 |
" ssize_t nread;\n" |
| 1574 |
" struct file_handle *fhp;\n" |
| 1575 |
"\\&\n" |
| 1576 |
" if ((argc E<gt> 1 && streq(argv[1], \"--help\")) || argc E<gt> 2) {\n" |
| 1577 |
" fprintf(stderr, \"Usage: %s [mount-path]\\[rs]n\", argv[0]);\n" |
| 1578 |
" exit(EXIT_FAILURE);\n" |
| 1579 |
" }\n" |
| 1580 |
"\\&\n" |
| 1581 |
" /* Standard input contains mount ID and file handle information:\n" |
| 1582 |
"\\&\n" |
| 1583 |
" Line 1: E<lt>mount_idE<gt>\n" |
| 1584 |
" Line 2: E<lt>handle_bytesE<gt> E<lt>handle_typeE<gt> E<lt>bytes of handle in hexE<gt>\n" |
| 1585 |
" */\n" |
| 1586 |
"\\&\n" |
| 1587 |
" if (fgets(line1, sizeof(line1), stdin) == NULL ||\n" |
| 1588 |
" fgets(line2, sizeof(line2), stdin) == NULL)\n" |
| 1589 |
" {\n" |
| 1590 |
" fprintf(stderr, \"Missing mount_id / file handle\\[rs]n\");\n" |
| 1591 |
" exit(EXIT_FAILURE);\n" |
| 1592 |
" }\n" |
| 1593 |
"\\&\n" |
| 1594 |
" mount_id = atoi(line1);\n" |
| 1595 |
"\\&\n" |
| 1596 |
" handle_bytes = strtoul(line2, &nextp, 0);\n" |
| 1597 |
"\\&\n" |
| 1598 |
" /* Given handle_bytes, we can now allocate file_handle structure. */\n" |
| 1599 |
"\\&\n" |
| 1600 |
" fhp = malloc(sizeof(*fhp) + handle_bytes);\n" |
| 1601 |
" if (fhp == NULL)\n" |
| 1602 |
" err(EXIT_FAILURE, \"malloc\");\n" |
| 1603 |
"\\&\n" |
| 1604 |
" fhp-E<gt>handle_bytes = handle_bytes;\n" |
| 1605 |
"\\&\n" |
| 1606 |
" fhp-E<gt>handle_type = strtoul(nextp, &nextp, 0);\n" |
| 1607 |
"\\&\n" |
| 1608 |
" for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n" |
| 1609 |
" fhp-E<gt>f_handle[j] = strtoul(nextp, &nextp, 16);\n" |
| 1610 |
"\\&\n" |
| 1611 |
" /* Obtain file descriptor for mount point, either by opening\n" |
| 1612 |
" the pathname specified on the command line, or by scanning\n" |
| 1613 |
" /proc/self/mounts to find a mount that matches the \\[aq]mount_id\\[aq]\n" |
| 1614 |
" that we received from stdin. */\n" |
| 1615 |
"\\&\n" |
| 1616 |
" if (argc E<gt> 1)\n" |
| 1617 |
" mount_fd = open(argv[1], O_RDONLY);\n" |
| 1618 |
" else\n" |
| 1619 |
" mount_fd = open_mount_path_by_id(mount_id);\n" |
| 1620 |
"\\&\n" |
| 1621 |
" if (mount_fd == -1)\n" |
| 1622 |
" err(EXIT_FAILURE, \"opening mount fd\");\n" |
| 1623 |
"\\&\n" |
| 1624 |
" /* Open file using handle and mount point. */\n" |
| 1625 |
"\\&\n" |
| 1626 |
" fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n" |
| 1627 |
" if (fd == -1)\n" |
| 1628 |
" err(EXIT_FAILURE, \"open_by_handle_at\");\n" |
| 1629 |
"\\&\n" |
| 1630 |
" /* Try reading a few bytes from the file. */\n" |
| 1631 |
"\\&\n" |
| 1632 |
" nread = read(fd, buf, sizeof(buf));\n" |
| 1633 |
" if (nread == -1)\n" |
| 1634 |
" err(EXIT_FAILURE, \"read\");\n" |
| 1635 |
"\\&\n" |
| 1636 |
" printf(\"Read %zd bytes\\[rs]n\", nread);\n" |
| 1637 |
"\\&\n" |
| 1638 |
" exit(EXIT_SUCCESS);\n" |
| 1639 |
"}\n" |
| 1640 |
msgstr "" |
| 1641 |
"#define _GNU_SOURCE\n" |
| 1642 |
"#include E<lt>err.hE<gt>\n" |
| 1643 |
"#include E<lt>fcntl.hE<gt>\n" |
| 1644 |
"#include E<lt>limits.hE<gt>\n" |
| 1645 |
"#include E<lt>stdio.hE<gt>\n" |
| 1646 |
"#include E<lt>stdlib.hE<gt>\n" |
| 1647 |
"#include E<lt>string.hE<gt>\n" |
| 1648 |
"#include E<lt>unistd.hE<gt>\n" |
| 1649 |
"\\&\n" |
| 1650 |
"/* Parcourt /proc/self/mountinfo pour trouver la ligne correspondant à \n" |
| 1651 |
" l'ID de montage \\[aq]mount_id\\[aq]. (Une méthode plus simple consiste à\n" |
| 1652 |
" installer et à utiliser la bibliothèque (\\[aq]libmount\\[aq] fournie par\n" |
| 1653 |
" le projet \\[aq]util-linux\\[aq].) Ouvre le point de montage correspondant\n" |
| 1654 |
" et renvoie le descripteur de fichier associé. */\n" |
| 1655 |
"\\&\n" |
| 1656 |
"static int\n" |
| 1657 |
"open_mount_path_by_id(int mount_id)\n" |
| 1658 |
"{\n" |
| 1659 |
" int mi_mount_id, found;\n" |
| 1660 |
" char mount_path[PATH_MAX];\n" |
| 1661 |
" char *linep;\n" |
| 1662 |
" FILE *fp;\n" |
| 1663 |
" size_t lsize;\n" |
| 1664 |
" ssize_t nread;\n" |
| 1665 |
"\\&\n" |
| 1666 |
" fp = fopen(\"/proc/self/mountinfo\", \"r\");\n" |
| 1667 |
" if (fp == NULL)\n" |
| 1668 |
" err(EXIT_FAILURE, \"fopen\");\n" |
| 1669 |
"\\&\n" |
| 1670 |
" found = 0;\n" |
| 1671 |
" linep = NULL;\n" |
| 1672 |
" while (!found) {\n" |
| 1673 |
" nread = getline(&linep, &lsize, fp);\n" |
| 1674 |
" if (nread == -1)\n" |
| 1675 |
" break;\n" |
| 1676 |
"\\&\n" |
| 1677 |
" nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n" |
| 1678 |
" &mi_mount_id, mount_path);\n" |
| 1679 |
" if (nread != 2) {\n" |
| 1680 |
" fprintf(stderr, \"Mauvais sscanf()\\en\");\n" |
| 1681 |
" exit(EXIT_FAILURE);\n" |
| 1682 |
" }\n" |
| 1683 |
"\\&\n" |
| 1684 |
" if (mi_mount_id == mount_id)\n" |
| 1685 |
" found = 1;\n" |
| 1686 |
" }\n" |
| 1687 |
" free(linep);\n" |
| 1688 |
"\\&\n" |
| 1689 |
" fclose(fp);\n" |
| 1690 |
"\\&\n" |
| 1691 |
" if (!found) {\n" |
| 1692 |
" fprintf(stderr, \"Point de montage non trouvé\\en\");\n" |
| 1693 |
" exit(EXIT_FAILURE);\n" |
| 1694 |
" }\n" |
| 1695 |
"\\&\n" |
| 1696 |
" return open(mount_path, O_RDONLY);\n" |
| 1697 |
"}\n" |
| 1698 |
"\\&\n" |
| 1699 |
"int\n" |
| 1700 |
"main(int argc, char *argv[])\n" |
| 1701 |
"{\n" |
| 1702 |
" int mount_id, fd, mount_fd, handle_bytes;\n" |
| 1703 |
" char buf[1000];\n" |
| 1704 |
"#define LINE_SIZE 100\n" |
| 1705 |
" char line1[LINE_SIZE], line2[LINE_SIZE];\n" |
| 1706 |
" char *nextp;\n" |
| 1707 |
" ssize_t nread;\n" |
| 1708 |
" struct file_handle *fhp;\n" |
| 1709 |
"\\&\n" |
| 1710 |
" if ((argc E<gt> 1 && strcmp(argv[1], \"--help\") == 0) || argc E<gt> 2) {\n" |
| 1711 |
" fprintf(stderr, \"Utilisation : %s [mount-path]\\en\", argv[0]);\n" |
| 1712 |
" exit(EXIT_FAILURE);\n" |
| 1713 |
" }\n" |
| 1714 |
"\\&\n" |
| 1715 |
" /* L'entrée standard contient l'identifiant de montage et\n" |
| 1716 |
" les informations de l'indicateur :\n" |
| 1717 |
"\\&\n" |
| 1718 |
" Ligne 1 : E<lt>mount_idE<gt>\n" |
| 1719 |
" Ligne 2 : E<lt>handle_bytesE<gt> E<lt>handle_typeE<gt> E<lt>octets du descripteur en hexadécimalE<gt>\n" |
| 1720 |
"\\&\n" |
| 1721 |
" if (fgets(line1, sizeof(line1), stdin) == NULL ||\n" |
| 1722 |
" fgets(line2, sizeof(line2), stdin) == NULL)\n" |
| 1723 |
" {\n" |
| 1724 |
" fprintf(stderr, \"mount_id ou descripteur de fichier absent\\en\");\n" |
| 1725 |
" exit(EXIT_FAILURE);\n" |
| 1726 |
" }\n" |
| 1727 |
"\\&\n" |
| 1728 |
" mount_id = atoi(line1);\n" |
| 1729 |
"\\&\n" |
| 1730 |
" handle_bytes = strtoul(line2, &nextp, 0);\n" |
| 1731 |
"\\&\n" |
| 1732 |
" /* handle_bytes étant connu, on peut maintenant allouer la structure\n" |
| 1733 |
" file_handle. */\n" |
| 1734 |
"\\&\n" |
| 1735 |
" fhp = malloc(sizeof(*fhp) + handle_bytes);\n" |
| 1736 |
" if (fhp == NULL)\n" |
| 1737 |
" err(EXIT_FAILURE, \"malloc\");\n" |
| 1738 |
"\\&\n" |
| 1739 |
" fhp-E<gt>handle_bytes = handle_bytes;\n" |
| 1740 |
"\\&\n" |
| 1741 |
" fhp-E<gt>handle_type = strtoul(nextp, &nextp, 0);\n" |
| 1742 |
"\\&\n" |
| 1743 |
" for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n" |
| 1744 |
" fhp-E<gt>f_handle[j] = strtoul(nextp, &nextp, 16);\n" |
| 1745 |
"\\&\n" |
| 1746 |
" /* Récupère le descripteur de fichier du point de montage, soit en ouvrant\n" |
| 1747 |
" le chemin indiqué dans la ligne de commande, soit en parcourant\n" |
| 1748 |
" /proc/self/mounts pour retrouver un montage qui corresponde à\n" |
| 1749 |
" \\[aq]mount_id\\[aq] qui a été reçu de stdin. */\n" |
| 1750 |
"\\&\n" |
| 1751 |
" if (argc E<gt> 1)\n" |
| 1752 |
" mount_fd = open(argv[1], O_RDONLY);\n" |
| 1753 |
" else\n" |
| 1754 |
" mount_fd = open_mount_path_by_id(mount_id);\n" |
| 1755 |
"\\&\n" |
| 1756 |
" if (mount_fd == -1)\n" |
| 1757 |
" err(EXIT_FAILURE, \"opening mount fd\");\n" |
| 1758 |
"\\&\n" |
| 1759 |
" /* Ouvre le fichier en utilisant l'indicateur et le point de montage. */\n" |
| 1760 |
"\\&\n" |
| 1761 |
" fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n" |
| 1762 |
" if (fd == -1)\n" |
| 1763 |
" err(EXIT_FAILURE, \"open_by_handle_at\");\n" |
| 1764 |
"\\&\n" |
| 1765 |
" /* On essaie de lire quelques octets depuis le fichier. */\n" |
| 1766 |
"\\&\n" |
| 1767 |
" nread = read(fd, buf, sizeof(buf));\n" |
| 1768 |
" if (nread == -1)\n" |
| 1769 |
" err(EXIT_FAILURE, \"read\");\n" |
| 1770 |
"\\&\n" |
| 1771 |
" printf(\"Lire %zd octets\\en\", nread);\n" |
| 1772 |
"\\&\n" |
| 1773 |
" exit(EXIT_SUCCESS);\n" |
| 1774 |
"}\n" |
| 1775 |
|
| 1776 |
#. SRC END |
| 1777 |
#. type: SH |
| 1778 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1779 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1780 |
#, no-wrap |
| 1781 |
msgid "SEE ALSO" |
| 1782 |
msgstr "VOIR AUSSI" |
| 1783 |
|
| 1784 |
#. type: Plain text |
| 1785 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 1786 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 1787 |
msgid "B<open>(2), B<libblkid>(3), B<blkid>(8), B<findfs>(8), B<mount>(8)" |
| 1788 |
msgstr "B<open>(2), B<libblkid>(3), B<blkid>(8), B<findfs>(8), B<mount>(8)" |
| 1789 |
|
| 1790 |
#. type: Plain text |
| 1791 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 1792 |
#: opensuse-tumbleweed |
| 1793 |
#, fuzzy |
| 1794 |
#| msgid "" |
| 1795 |
#| "The I<libblkid> and I<libmount> documentation in the latest I<util-linux> " |
| 1796 |
#| "release at E<.UR https://www.kernel.org/pub/linux/utils/util-linux/> " |
| 1797 |
#| "E<.UE>" |
| 1798 |
msgid "" |
| 1799 |
"The I<libblkid> and I<libmount> documentation in the latest I<util-linux> " |
| 1800 |
"release at E<.UR https:\\://www.kernel.org/pub/linux/utils/util-linux/> " |
| 1801 |
"E<.UE>" |
| 1802 |
msgstr "" |
| 1803 |
"La documentation relative à I<libblkid> et à I<libmount> de la dernière " |
| 1804 |
"publication de I<util-linux> à E<.UR https://www.kernel.org/pub/linux/utils/" |
| 1805 |
"util-linux/> E<.UE>" |
| 1806 |
|
| 1807 |
#. type: TH |
| 1808 |
#: debian-trixie |
| 1809 |
#, no-wrap |
| 1810 |
msgid "2024-06-15" |
| 1811 |
msgstr "15 juin 2024" |
| 1812 |
|
| 1813 |
#. type: TH |
| 1814 |
#: debian-trixie |
| 1815 |
#, no-wrap |
| 1816 |
msgid "Linux man-pages 6.9.1" |
| 1817 |
msgstr "Pages du manuel de Linux 6.9.1" |
| 1818 |
|
| 1819 |
#. type: Plain text |
| 1820 |
#: debian-trixie |
| 1821 |
msgid "Standard C library (I<libc>, I<-lc>)" |
| 1822 |
msgstr "Bibliothèque C standard (I<libc>, I<-lc>)" |
| 1823 |
|
| 1824 |
#. type: Plain text |
| 1825 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1826 |
#, no-wrap |
| 1827 |
msgid "" |
| 1828 |
"B<int name_to_handle_at(int >I<dirfd>B<, const char *>I<pathname>B<,>\n" |
| 1829 |
"B< struct file_handle *>I<handle>B<,>\n" |
| 1830 |
"B< int *>I<mount_id>B<, int >I<flags>B<);>\n" |
| 1831 |
"B<int open_by_handle_at(int >I<mount_fd>B<, struct file_handle *>I<handle>B<,>\n" |
| 1832 |
"B< int >I<flags>B<);>\n" |
| 1833 |
msgstr "" |
| 1834 |
"B<int name_to_handle_at(int >I<dirfd>B<, const char *>I<pathname>B<,>\n" |
| 1835 |
"B< struct file_handle *>I<handle>B<,>\n" |
| 1836 |
"B< int *>I<mount_id>B<, int >I<flags>B<);>\n" |
| 1837 |
"B<int open_by_handle_at(int >I<mount_fd>B<, struct file_handle *>I<handle>B<,>\n" |
| 1838 |
"B< int >I<flags>B<);>\n" |
| 1839 |
|
| 1840 |
#. type: Plain text |
| 1841 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1842 |
msgid "" |
| 1843 |
"The B<name_to_handle_at>() system call returns a file handle and a mount ID " |
| 1844 |
"corresponding to the file specified by the I<dirfd> and I<pathname> " |
| 1845 |
"arguments. The file handle is returned via the argument I<handle>, which is " |
| 1846 |
"a pointer to a structure of the following form:" |
| 1847 |
msgstr "" |
| 1848 |
"L'appel système B<name_to_handle_at>() renvoie un gestionnaire de fichier et " |
| 1849 |
"un identifiant de montage (« mount ID ») correspondant au fichier désigné " |
| 1850 |
"par les arguments I<dirfd> et I<pathname>. Le gestionnaire de fichier est " |
| 1851 |
"renvoyé au moyen de l'argument I<handle>. Cet argument est un pointeur vers " |
| 1852 |
"une structure qui présente la forme suivante :" |
| 1853 |
|
| 1854 |
#. type: Plain text |
| 1855 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1856 |
msgid "" |
| 1857 |
"The I<flags> argument is a bit mask constructed by ORing together zero or " |
| 1858 |
"more of B<AT_HANDLE_FID>, B<AT_EMPTY_PATH>, and B<AT_SYMLINK_FOLLOW>, " |
| 1859 |
"described below." |
| 1860 |
msgstr "" |
| 1861 |
"L'argument I<flags> est un masque de bits construit par I<OU> binaire entre " |
| 1862 |
"zéro ou plus de B<AT_EMPTY_PATH> et B<AT_SYMLINK_FOLLOW>, décrits plus bas." |
| 1863 |
|
| 1864 |
#. type: Plain text |
| 1865 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1866 |
msgid "" |
| 1867 |
"Together, the I<pathname> and I<dirfd> arguments identify the file for which " |
| 1868 |
"a handle is to be obtained. There are four distinct cases:" |
| 1869 |
msgstr "" |
| 1870 |
"Ensemble, les arguments I<pathname> et I<dirfd> désignent le fichier pour " |
| 1871 |
"lequel on souhaite obtenir un gestionnaire. On distingue quatre cas : " |
| 1872 |
|
| 1873 |
#. type: Plain text |
| 1874 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1875 |
msgid "" |
| 1876 |
"If I<pathname> is a nonempty string containing an absolute pathname, then a " |
| 1877 |
"handle is returned for the file referred to by that pathname. In this case, " |
| 1878 |
"I<dirfd> is ignored." |
| 1879 |
msgstr "" |
| 1880 |
"Si I<pathname> est une chaîne non vide contenant un chemin d'accès absolu, " |
| 1881 |
"alors un gestionnaire est renvoyé pour le fichier indiqué par ce chemin. " |
| 1882 |
"Dans ce cas, I<dirfd> est ignoré." |
| 1883 |
|
| 1884 |
#. type: Plain text |
| 1885 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1886 |
msgid "" |
| 1887 |
"If I<pathname> is a nonempty string containing a relative pathname and " |
| 1888 |
"I<dirfd> has the special value B<AT_FDCWD>, then I<pathname> is interpreted " |
| 1889 |
"relative to the current working directory of the caller, and a handle is " |
| 1890 |
"returned for the file to which it refers." |
| 1891 |
msgstr "" |
| 1892 |
"Si I<pathname> est une chaîne non vide contenant un chemin relatif, et si " |
| 1893 |
"I<dirfd> a la valeur spéciale B<AT_FDCWD>, alors I<pathname> est interprété " |
| 1894 |
"par rapport au répertoire courant du processus appelant, et un gestionnaire " |
| 1895 |
"est renvoyé pour le fichier indiqué par le chemin." |
| 1896 |
|
| 1897 |
#. type: Plain text |
| 1898 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1899 |
msgid "" |
| 1900 |
"If I<pathname> is a nonempty string containing a relative pathname and " |
| 1901 |
"I<dirfd> is a file descriptor referring to a directory, then I<pathname> is " |
| 1902 |
"interpreted relative to the directory referred to by I<dirfd>, and a handle " |
| 1903 |
"is returned for the file to which it refers. (See B<openat>(2) for an " |
| 1904 |
"explanation of why \"directory file descriptors\" are useful.)" |
| 1905 |
msgstr "" |
| 1906 |
"Si I<pathname> est une chaîne non vide contenant un chemin d'accès relatif " |
| 1907 |
"et si I<dirfd> est le descripteur de fichier d'un répertoire, alors " |
| 1908 |
"I<pathname> est interprété par rapport au répertoire désigné par I<dirfd>, " |
| 1909 |
"et un gestionnaire est renvoyé pour le fichier indiqué par le chemin. " |
| 1910 |
"(Consultez B<openat>(3) si vous souhaitez comprendre à quoi servent les " |
| 1911 |
"« descripteurs de fichier de répertoires »)." |
| 1912 |
|
| 1913 |
#. type: Plain text |
| 1914 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1915 |
msgid "" |
| 1916 |
"If I<pathname> is an empty string and I<flags> specifies the value " |
| 1917 |
"B<AT_EMPTY_PATH>, then I<dirfd> can be an open file descriptor referring to " |
| 1918 |
"any type of file, or B<AT_FDCWD>, meaning the current working directory, and " |
| 1919 |
"a handle is returned for the file to which it refers." |
| 1920 |
msgstr "" |
| 1921 |
"Si I<pathname> est une chaîne vide, et si I<flags> précise la valeur de " |
| 1922 |
"B<AT_EMPTY_PATH>, alors I<dirfd> peut être un descripteur de fichiers ouvert " |
| 1923 |
"faisant référence à n'importe quel type de fichier ou à B<AT_FDCWD> " |
| 1924 |
"(répertoire de travail courant), et un gestionnaire est renvoyé pour le " |
| 1925 |
"fichier auquel il fait référence." |
| 1926 |
|
| 1927 |
#. type: Plain text |
| 1928 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1929 |
msgid "" |
| 1930 |
"The I<mount_id> argument returns an identifier for the filesystem mount that " |
| 1931 |
"corresponds to I<pathname>. This corresponds to the first field in one of " |
| 1932 |
"the records in I</proc/self/mountinfo>. Opening the pathname in the fifth " |
| 1933 |
"field of that record yields a file descriptor for the mount point; that file " |
| 1934 |
"descriptor can be used in a subsequent call to B<open_by_handle_at>(). " |
| 1935 |
"I<mount_id> is returned both for a successful call and for a call that " |
| 1936 |
"results in the error B<EOVERFLOW>." |
| 1937 |
msgstr "" |
| 1938 |
"L'argument I<mount_id> renvoie un identifiant pour le point de montage du " |
| 1939 |
"système de fichiers correspondant à I<pathname>. Cet identifiant correspond " |
| 1940 |
"au premier champ des entrées de I</proc/self/mountinfo>. L'ouverture du " |
| 1941 |
"chemin indiqué dans le cinquième champ délivre un descripteur de fichier " |
| 1942 |
"pour le point de montage ; ce descripteur de fichier peut être utilisé par " |
| 1943 |
"la suite lors d'un appel à B<open_by_handle_at>(). I<mount_id> est renvoyé " |
| 1944 |
"tant en cas de succès qu'en cas d'erreur B<EOVERFLOW> de l'appel." |
| 1945 |
|
| 1946 |
#. type: Plain text |
| 1947 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1948 |
msgid "" |
| 1949 |
"By default, B<name_to_handle_at>() does not dereference I<pathname> if it " |
| 1950 |
"is a symbolic link, and thus returns a handle for the link itself. If " |
| 1951 |
"B<AT_SYMLINK_FOLLOW> is specified in I<flags>, I<pathname> is dereferenced " |
| 1952 |
"if it is a symbolic link (so that the call returns a handle for the file " |
| 1953 |
"referred to by the link)." |
| 1954 |
msgstr "" |
| 1955 |
"Par défaut, B<name_to_handle_at>() ne déréférence pas I<pathname> s'il " |
| 1956 |
"s'agit d'un lien symbolique, et donc renvoie un gestionnaire pour le lien " |
| 1957 |
"lui-même. Si B<AT_SYMLINK_FOLLOW> est précisé dans I<flags>, I<pathname> est " |
| 1958 |
"déréférencé s'il s'agit d'un lien symbolique (de sorte que l'appel renvoie " |
| 1959 |
"un indicateur pour le fichier vers lequel pointe le lien symbolique)." |
| 1960 |
|
| 1961 |
#. type: Plain text |
| 1962 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1963 |
msgid "" |
| 1964 |
"I<pathname>, I<mount_id>, or I<handle> points outside your accessible " |
| 1965 |
"address space." |
| 1966 |
msgstr "" |
| 1967 |
"I<pathname>, I<mount_id> ou I<handle> pointe en dehors de l'espace " |
| 1968 |
"d'adressage accessible." |
| 1969 |
|
| 1970 |
#. type: Plain text |
| 1971 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1972 |
msgid "I<flags> includes an invalid bit value." |
| 1973 |
msgstr "I<flags> comprend un bit incorrect." |
| 1974 |
|
| 1975 |
#. type: Plain text |
| 1976 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1977 |
msgid "" |
| 1978 |
"I<pathname> is an empty string, but B<AT_EMPTY_PATH> was not specified in " |
| 1979 |
"I<flags>." |
| 1980 |
msgstr "" |
| 1981 |
"I<pathname> est une chaîne vide et B<AT_EMPTY_PATH> n’était pas indiqué dans " |
| 1982 |
"I<flags>." |
| 1983 |
|
| 1984 |
#. type: Plain text |
| 1985 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1986 |
msgid "" |
| 1987 |
"The file descriptor supplied in I<dirfd> does not refer to a directory, and " |
| 1988 |
"it is not the case that both I<flags> includes B<AT_EMPTY_PATH> and " |
| 1989 |
"I<pathname> is an empty string." |
| 1990 |
msgstr "" |
| 1991 |
"Le descripteur de fichiers fourni dans I<dirfd> ne fait pas référence à un " |
| 1992 |
"répertoire, et il ne s'agit pas du cas où I<flags> comprend B<AT_EMPTY_PATH> " |
| 1993 |
"et I<pathname> est une chaîne vide." |
| 1994 |
|
| 1995 |
#. type: Plain text |
| 1996 |
#: debian-trixie fedora-44 fedora-rawhide |
| 1997 |
msgid "" |
| 1998 |
"I<pathname> is relative but I<dirfd> is neither B<AT_FDCWD> nor a valid file " |
| 1999 |
"descriptor." |
| 2000 |
msgstr "" |
| 2001 |
"I<pathname> est relatif mais I<dirfd> n'est ni B<AT_FDWCD> ni un descripteur " |
| 2002 |
"de fichier valable." |
| 2003 |
|
| 2004 |
#. type: Plain text |
| 2005 |
#: debian-trixie fedora-44 fedora-rawhide |
| 2006 |
msgid "" |
| 2007 |
"The specified I<handle> is not valid for opening a file. This error will " |
| 2008 |
"occur if, for example, the file has been deleted. This error can also occur " |
| 2009 |
"if the I<handle> was acquired using the B<AT_HANDLE_FID> flag and the " |
| 2010 |
"filesystem does not support B<open_by_handle_at>()." |
| 2011 |
msgstr "" |
| 2012 |
|
| 2013 |
#. commit bcda76524cd1fa32af748536f27f674a13e56700 |
| 2014 |
#. type: Plain text |
| 2015 |
#: debian-trixie fedora-44 fedora-rawhide |
| 2016 |
msgid "" |
| 2017 |
"If I<pathname> refers to a symbolic link and I<flags> does not specify " |
| 2018 |
"B<AT_SYMLINK_FOLLOW>, then B<name_to_handle_at>() returns a handle for the " |
| 2019 |
"link (rather than the file to which it refers). The process receiving the " |
| 2020 |
"handle can later perform operations on the symbolic link by converting the " |
| 2021 |
"handle to a file descriptor using B<open_by_handle_at>() with the B<O_PATH> " |
| 2022 |
"flag, and then passing the file descriptor as the I<dirfd> argument in " |
| 2023 |
"system calls such as B<readlinkat>(2) and B<fchownat>(2)." |
| 2024 |
msgstr "" |
| 2025 |
"Si I<pathname> fait référence à un lien symbolique et si I<flags> ne précise " |
| 2026 |
"pas B<AT_SYMLINK_FOLLOW>, alors B<name_to_handle_at>() renvoie un indicateur " |
| 2027 |
"pour le lien (plutôt que pour le fichier vers lequel le lien pointe). Le " |
| 2028 |
"processus recevant l'indicateur peut effectuer plus tard une opération sur " |
| 2029 |
"ce lien symbolique, en convertissant l'indicateur en descripteur de fichier " |
| 2030 |
"au moyen de B<open_by_handle_at>() utilisé avec l'argument B<O_PATH>, et en " |
| 2031 |
"passant le descripteur de fichier en argument I<dirfd> d’appels système " |
| 2032 |
"(tels que B<readlinkat>(2) et B<fchownat>(2)). " |
| 2033 |
|
| 2034 |
#. type: Plain text |
| 2035 |
#: debian-trixie fedora-44 fedora-rawhide |
| 2036 |
#, no-wrap |
| 2037 |
msgid "" |
| 2038 |
"$ B<echo \\[aq]Can you please think about it?\\[aq] E<gt> cecilia.txt>\n" |
| 2039 |
"$ B<./t_name_to_handle_at cecilia.txt E<gt> fh>\n" |
| 2040 |
"$ B<./t_open_by_handle_at E<lt> fh>\n" |
| 2041 |
"open_by_handle_at: Operation not permitted\n" |
| 2042 |
"$ B<sudo ./t_open_by_handle_at E<lt> fh> # Need CAP_SYS_ADMIN\n" |
| 2043 |
"Read 31 bytes\n" |
| 2044 |
"$ B<rm cecilia.txt>\n" |
| 2045 |
msgstr "" |
| 2046 |
"$ B<echo \\[aq]Can you please think about it?\\[aq] E<gt> cecilia.txt>\n" |
| 2047 |
"$ B<./t_name_to_handle_at cecilia.txt E<gt> fh>\n" |
| 2048 |
"$ B<./t_open_by_handle_at E<lt> fh>\n" |
| 2049 |
"open_by_handle_at: Operation not permitted\n" |
| 2050 |
"$ B<sudo ./t_open_by_handle_at E<lt> fh> # Nécessite CAP_SYS_ADMIN\n" |
| 2051 |
"Read 31 bytes\n" |
| 2052 |
"$ B<rm cecilia.txt>\n" |
| 2053 |
|
| 2054 |
#. type: Plain text |
| 2055 |
#: debian-trixie fedora-44 fedora-rawhide |
| 2056 |
#, fuzzy, no-wrap |
| 2057 |
#| msgid "" |
| 2058 |
#| "$ B<stat --printf=\"%i\\en\" cecilia.txt> # Display inode number\n" |
| 2059 |
#| "4072121\n" |
| 2060 |
#| "$ B<rm cecilia.txt>\n" |
| 2061 |
#| "$ B<echo \\[aq]Can you please think about it?\\[aq] E<gt> cecilia.txt>\n" |
| 2062 |
#| "$ B<stat --printf=\"%i\\en\" cecilia.txt> # Check inode number\n" |
| 2063 |
#| "4072121\n" |
| 2064 |
#| "$ B<sudo ./t_open_by_handle_at E<lt> fh>\n" |
| 2065 |
#| "open_by_handle_at: Stale NFS file handle\n" |
| 2066 |
msgid "" |
| 2067 |
"$ B<stat --printf=\"%i\\[rs]n\" cecilia.txt> # Display inode number\n" |
| 2068 |
"4072121\n" |
| 2069 |
"$ B<rm cecilia.txt>\n" |
| 2070 |
"$ B<echo \\[aq]Can you please think about it?\\[aq] E<gt> cecilia.txt>\n" |
| 2071 |
"$ B<stat --printf=\"%i\\[rs]n\" cecilia.txt> # Check inode number\n" |
| 2072 |
"4072121\n" |
| 2073 |
"$ B<sudo ./t_open_by_handle_at E<lt> fh>\n" |
| 2074 |
"open_by_handle_at: Stale NFS file handle\n" |
| 2075 |
msgstr "" |
| 2076 |
"$ B<stat --printf=\"%i\\en\" cecilia.txt> # Affiche le numéro d'inœud\n" |
| 2077 |
"4072121\n" |
| 2078 |
"$ B<rm cecilia.txt>\n" |
| 2079 |
"$ B<echo \\[aq]Can you please think about it?\\[aq] E<gt> cecilia.txt>\n" |
| 2080 |
"$ B<stat --printf=\"%i\\en\" cecilia.txt> # Vérifie le numéro d'inœud\n" |
| 2081 |
"4072121\n" |
| 2082 |
"$ B<sudo ./t_open_by_handle_at E<lt> fh>\n" |
| 2083 |
"open_by_handle_at: Stale NFS file handle\n" |
| 2084 |
|
| 2085 |
#. type: Plain text |
| 2086 |
#: debian-trixie fedora-44 fedora-rawhide |
| 2087 |
#, fuzzy, no-wrap |
| 2088 |
#| msgid "" |
| 2089 |
#| "#define _GNU_SOURCE\n" |
| 2090 |
#| "#include E<lt>err.hE<gt>\n" |
| 2091 |
#| "#include E<lt>errno.hE<gt>\n" |
| 2092 |
#| "#include E<lt>fcntl.hE<gt>\n" |
| 2093 |
#| "#include E<lt>stdio.hE<gt>\n" |
| 2094 |
#| "#include E<lt>stdlib.hE<gt>\n" |
| 2095 |
#| "\\&\n" |
| 2096 |
#| "int\n" |
| 2097 |
#| "main(int argc, char *argv[])\n" |
| 2098 |
#| "{\n" |
| 2099 |
#| " int mount_id, fhsize, flags, dirfd;\n" |
| 2100 |
#| " char *pathname;\n" |
| 2101 |
#| " struct file_handle *fhp;\n" |
| 2102 |
#| "\\&\n" |
| 2103 |
#| " if (argc != 2) {\n" |
| 2104 |
#| " fprintf(stderr, \"Usage: %s pathname\\en\", argv[0]);\n" |
| 2105 |
#| " exit(EXIT_FAILURE);\n" |
| 2106 |
#| " }\n" |
| 2107 |
#| "\\&\n" |
| 2108 |
#| " pathname = argv[1];\n" |
| 2109 |
#| "\\&\n" |
| 2110 |
#| " /* Allocate file_handle structure. */\n" |
| 2111 |
#| "\\&\n" |
| 2112 |
#| " fhsize = sizeof(*fhp);\n" |
| 2113 |
#| " fhp = malloc(fhsize);\n" |
| 2114 |
#| " if (fhp == NULL)\n" |
| 2115 |
#| " err(EXIT_FAILURE, \"malloc\");\n" |
| 2116 |
#| "\\&\n" |
| 2117 |
#| " /* Make an initial call to name_to_handle_at() to discover\n" |
| 2118 |
#| " the size required for file handle. */\n" |
| 2119 |
#| "\\&\n" |
| 2120 |
#| " dirfd = AT_FDCWD; /* For name_to_handle_at() calls */\n" |
| 2121 |
#| " flags = 0; /* For name_to_handle_at() calls */\n" |
| 2122 |
#| " fhp-E<gt>handle_bytes = 0;\n" |
| 2123 |
#| " if (name_to_handle_at(dirfd, pathname, fhp,\n" |
| 2124 |
#| " &mount_id, flags) != -1\n" |
| 2125 |
#| " || errno != EOVERFLOW)\n" |
| 2126 |
#| " {\n" |
| 2127 |
#| " fprintf(stderr, \"Unexpected result from name_to_handle_at()\\en\");\n" |
| 2128 |
#| " exit(EXIT_FAILURE);\n" |
| 2129 |
#| " }\n" |
| 2130 |
#| "\\&\n" |
| 2131 |
#| " /* Reallocate file_handle structure with correct size. */\n" |
| 2132 |
#| "\\&\n" |
| 2133 |
#| " fhsize = sizeof(*fhp) + fhp-E<gt>handle_bytes;\n" |
| 2134 |
#| " fhp = realloc(fhp, fhsize); /* Copies fhp-E<gt>handle_bytes */\n" |
| 2135 |
#| " if (fhp == NULL)\n" |
| 2136 |
#| " err(EXIT_FAILURE, \"realloc\");\n" |
| 2137 |
#| "\\&\n" |
| 2138 |
#| " /* Get file handle from pathname supplied on command line. */\n" |
| 2139 |
#| "\\&\n" |
| 2140 |
#| " if (name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags) == -1)\n" |
| 2141 |
#| " err(EXIT_FAILURE, \"name_to_handle_at\");\n" |
| 2142 |
#| "\\&\n" |
| 2143 |
#| " /* Write mount ID, file handle size, and file handle to stdout,\n" |
| 2144 |
#| " for later reuse by t_open_by_handle_at.c. */\n" |
| 2145 |
#| "\\&\n" |
| 2146 |
#| " printf(\"%d\\en\", mount_id);\n" |
| 2147 |
#| " printf(\"%u %d \", fhp-E<gt>handle_bytes, fhp-E<gt>handle_type);\n" |
| 2148 |
#| " for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n" |
| 2149 |
#| " printf(\" %02x\", fhp-E<gt>f_handle[j]);\n" |
| 2150 |
#| " printf(\"\\en\");\n" |
| 2151 |
#| "\\&\n" |
| 2152 |
#| " exit(EXIT_SUCCESS);\n" |
| 2153 |
#| "}\n" |
| 2154 |
msgid "" |
| 2155 |
"#define _GNU_SOURCE\n" |
| 2156 |
"#include E<lt>err.hE<gt>\n" |
| 2157 |
"#include E<lt>errno.hE<gt>\n" |
| 2158 |
"#include E<lt>fcntl.hE<gt>\n" |
| 2159 |
"#include E<lt>stdio.hE<gt>\n" |
| 2160 |
"#include E<lt>stdlib.hE<gt>\n" |
| 2161 |
"\\&\n" |
| 2162 |
"int\n" |
| 2163 |
"main(int argc, char *argv[])\n" |
| 2164 |
"{\n" |
| 2165 |
" int mount_id, fhsize, flags, dirfd;\n" |
| 2166 |
" char *pathname;\n" |
| 2167 |
" struct file_handle *fhp;\n" |
| 2168 |
"\\&\n" |
| 2169 |
" if (argc != 2) {\n" |
| 2170 |
" fprintf(stderr, \"Usage: %s pathname\\[rs]n\", argv[0]);\n" |
| 2171 |
" exit(EXIT_FAILURE);\n" |
| 2172 |
" }\n" |
| 2173 |
"\\&\n" |
| 2174 |
" pathname = argv[1];\n" |
| 2175 |
"\\&\n" |
| 2176 |
" /* Allocate file_handle structure. */\n" |
| 2177 |
"\\&\n" |
| 2178 |
" fhsize = sizeof(*fhp);\n" |
| 2179 |
" fhp = malloc(fhsize);\n" |
| 2180 |
" if (fhp == NULL)\n" |
| 2181 |
" err(EXIT_FAILURE, \"malloc\");\n" |
| 2182 |
"\\&\n" |
| 2183 |
" /* Make an initial call to name_to_handle_at() to discover\n" |
| 2184 |
" the size required for file handle. */\n" |
| 2185 |
"\\&\n" |
| 2186 |
" dirfd = AT_FDCWD; /* For name_to_handle_at() calls */\n" |
| 2187 |
" flags = 0; /* For name_to_handle_at() calls */\n" |
| 2188 |
" fhp-E<gt>handle_bytes = 0;\n" |
| 2189 |
" if (name_to_handle_at(dirfd, pathname, fhp,\n" |
| 2190 |
" &mount_id, flags) != -1\n" |
| 2191 |
" || errno != EOVERFLOW)\n" |
| 2192 |
" {\n" |
| 2193 |
" fprintf(stderr, \"Unexpected result from name_to_handle_at()\\[rs]n\");\n" |
| 2194 |
" exit(EXIT_FAILURE);\n" |
| 2195 |
" }\n" |
| 2196 |
"\\&\n" |
| 2197 |
" /* Reallocate file_handle structure with correct size. */\n" |
| 2198 |
"\\&\n" |
| 2199 |
" fhsize = sizeof(*fhp) + fhp-E<gt>handle_bytes;\n" |
| 2200 |
" fhp = realloc(fhp, fhsize); /* Copies fhp-E<gt>handle_bytes */\n" |
| 2201 |
" if (fhp == NULL)\n" |
| 2202 |
" err(EXIT_FAILURE, \"realloc\");\n" |
| 2203 |
"\\&\n" |
| 2204 |
" /* Get file handle from pathname supplied on command line. */\n" |
| 2205 |
"\\&\n" |
| 2206 |
" if (name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags) == -1)\n" |
| 2207 |
" err(EXIT_FAILURE, \"name_to_handle_at\");\n" |
| 2208 |
"\\&\n" |
| 2209 |
" /* Write mount ID, file handle size, and file handle to stdout,\n" |
| 2210 |
" for later reuse by t_open_by_handle_at.c. */\n" |
| 2211 |
"\\&\n" |
| 2212 |
" printf(\"%d\\[rs]n\", mount_id);\n" |
| 2213 |
" printf(\"%u %d \", fhp-E<gt>handle_bytes, fhp-E<gt>handle_type);\n" |
| 2214 |
" for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n" |
| 2215 |
" printf(\" %02x\", fhp-E<gt>f_handle[j]);\n" |
| 2216 |
" printf(\"\\[rs]n\");\n" |
| 2217 |
"\\&\n" |
| 2218 |
" exit(EXIT_SUCCESS);\n" |
| 2219 |
"}\n" |
| 2220 |
msgstr "" |
| 2221 |
"#define _GNU_SOURCE\n" |
| 2222 |
"#include E<lt>err.hE<gt>\n" |
| 2223 |
"#include E<lt>errno.hE<gt>\n" |
| 2224 |
"#include E<lt>fcntl.hE<gt>\n" |
| 2225 |
"#include E<lt>stdio.hE<gt>\n" |
| 2226 |
"#include E<lt>stdlib.hE<gt>\n" |
| 2227 |
"\\&\n" |
| 2228 |
"int\n" |
| 2229 |
"main(int argc, char *argv[])\n" |
| 2230 |
"{\n" |
| 2231 |
" int mount_id, fhsize, flags, dirfd;\n" |
| 2232 |
" char *pathname;\n" |
| 2233 |
" struct file_handle *fhp;\n" |
| 2234 |
"\\&\n" |
| 2235 |
" if (argc != 2) {\n" |
| 2236 |
" fprintf(stderr, \"Utilisation : %s pathname\\en\", argv[0]);\n" |
| 2237 |
" exit(EXIT_FAILURE);\n" |
| 2238 |
" }\n" |
| 2239 |
"\\&\n" |
| 2240 |
" pathname = argv[1];\n" |
| 2241 |
"\\&\n" |
| 2242 |
" /* Allocate file_handle structure. */\n" |
| 2243 |
"\\&\n" |
| 2244 |
" fhsize = sizeof(*fhp);\n" |
| 2245 |
" fhp = malloc(fhsize);\n" |
| 2246 |
" if (fhp == NULL)\n" |
| 2247 |
" err(EXIT_FAILURE, \"malloc\");\n" |
| 2248 |
"\\&\n" |
| 2249 |
" /* Effectue un appel initial à name_to_handle_at() afin de connaître\n" |
| 2250 |
" la taille nécessaire à l'indicateur de fichier. */\n" |
| 2251 |
"\\&\n" |
| 2252 |
" dirfd = AT_FDCWD; /* Pour les appels à name_to_handle_at() */\n" |
| 2253 |
" flags = 0; /* Pour les appels à name_to_handle_at() */\n" |
| 2254 |
" fhp-E<gt>handle_bytes = 0;\n" |
| 2255 |
" if (name_to_handle_at(dirfd, pathname, fhp,\n" |
| 2256 |
" &mount_id, flags) != -1\n" |
| 2257 |
" || errno != EOVERFLOW)\n" |
| 2258 |
" {\n" |
| 2259 |
" fprintf(stderr, \"Résultat inattendu de name_to_handle_at()\\en\");\n" |
| 2260 |
" exit(EXIT_FAILURE);\n" |
| 2261 |
" }\n" |
| 2262 |
"\\&\n" |
| 2263 |
" /* Ré-alloue la structure file_handle avec la bonne taille. */\n" |
| 2264 |
"\\&\n" |
| 2265 |
" fhsize = sizeof(*fhp) + fhp-E<gt>handle_bytes;\n" |
| 2266 |
" fhp = realloc(fhp, fhsize); /* Copies fhp-E<gt>handle_bytes */\n" |
| 2267 |
" if (fhp == NULL)\n" |
| 2268 |
" err(EXIT_FAILURE, \"realloc\");\n" |
| 2269 |
"\\&\n" |
| 2270 |
" /* Retrouve l'indicateur de fichier à partir du\n" |
| 2271 |
" chemin fourni dans la ligne de commande. */\n" |
| 2272 |
"\\&\n" |
| 2273 |
" if (name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags) == -1)\n" |
| 2274 |
" err(EXIT_FAILURE, \"name_to_handle_at\");\n" |
| 2275 |
"\\&\n" |
| 2276 |
" /* Écrit l'identifiant de montage, la taille de l'indicateur et\n" |
| 2277 |
" l'indicateur vers la sortie standard pour être utilisés\n" |
| 2278 |
" plus tard par t_open_by_handle_at.c. */\n" |
| 2279 |
"\\&\n" |
| 2280 |
" printf(\"%d\\en\", mount_id);\n" |
| 2281 |
" printf(\"%u %d \", fhp-E<gt>handle_bytes, fhp-E<gt>handle_type);\n" |
| 2282 |
" for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n" |
| 2283 |
" printf(\" %02x\", fhp-E<gt>f_handle[j]);\n" |
| 2284 |
" printf(\"\\en\");\n" |
| 2285 |
"\\&\n" |
| 2286 |
" exit(EXIT_SUCCESS);\n" |
| 2287 |
"}\n" |
| 2288 |
|
| 2289 |
#. type: Plain text |
| 2290 |
#: debian-trixie fedora-44 fedora-rawhide |
| 2291 |
#, fuzzy, no-wrap |
| 2292 |
#| msgid "" |
| 2293 |
#| "#define _GNU_SOURCE\n" |
| 2294 |
#| "#include E<lt>err.hE<gt>\n" |
| 2295 |
#| "#include E<lt>fcntl.hE<gt>\n" |
| 2296 |
#| "#include E<lt>limits.hE<gt>\n" |
| 2297 |
#| "#include E<lt>stdio.hE<gt>\n" |
| 2298 |
#| "#include E<lt>stdlib.hE<gt>\n" |
| 2299 |
#| "#include E<lt>string.hE<gt>\n" |
| 2300 |
#| "#include E<lt>unistd.hE<gt>\n" |
| 2301 |
#| "\\&\n" |
| 2302 |
#| "/* Scan /proc/self/mountinfo to find the line whose mount ID matches\n" |
| 2303 |
#| " \\[aq]mount_id\\[aq]. (An easier way to do this is to install and use the\n" |
| 2304 |
#| " \\[aq]libmount\\[aq] library provided by the \\[aq]util-linux\\[aq] project.)\n" |
| 2305 |
#| " Open the corresponding mount path and return the resulting file\n" |
| 2306 |
#| " descriptor. */\n" |
| 2307 |
#| "\\&\n" |
| 2308 |
#| "static int\n" |
| 2309 |
#| "open_mount_path_by_id(int mount_id)\n" |
| 2310 |
#| "{\n" |
| 2311 |
#| " int mi_mount_id, found;\n" |
| 2312 |
#| " char mount_path[PATH_MAX];\n" |
| 2313 |
#| " char *linep;\n" |
| 2314 |
#| " FILE *fp;\n" |
| 2315 |
#| " size_t lsize;\n" |
| 2316 |
#| " ssize_t nread;\n" |
| 2317 |
#| "\\&\n" |
| 2318 |
#| " fp = fopen(\"/proc/self/mountinfo\", \"r\");\n" |
| 2319 |
#| " if (fp == NULL)\n" |
| 2320 |
#| " err(EXIT_FAILURE, \"fopen\");\n" |
| 2321 |
#| "\\&\n" |
| 2322 |
#| " found = 0;\n" |
| 2323 |
#| " linep = NULL;\n" |
| 2324 |
#| " while (!found) {\n" |
| 2325 |
#| " nread = getline(&linep, &lsize, fp);\n" |
| 2326 |
#| " if (nread == -1)\n" |
| 2327 |
#| " break;\n" |
| 2328 |
#| "\\&\n" |
| 2329 |
#| " nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n" |
| 2330 |
#| " &mi_mount_id, mount_path);\n" |
| 2331 |
#| " if (nread != 2) {\n" |
| 2332 |
#| " fprintf(stderr, \"Bad sscanf()\\en\");\n" |
| 2333 |
#| " exit(EXIT_FAILURE);\n" |
| 2334 |
#| " }\n" |
| 2335 |
#| "\\&\n" |
| 2336 |
#| " if (mi_mount_id == mount_id)\n" |
| 2337 |
#| " found = 1;\n" |
| 2338 |
#| " }\n" |
| 2339 |
#| " free(linep);\n" |
| 2340 |
#| "\\&\n" |
| 2341 |
#| " fclose(fp);\n" |
| 2342 |
#| "\\&\n" |
| 2343 |
#| " if (!found) {\n" |
| 2344 |
#| " fprintf(stderr, \"Could not find mount point\\en\");\n" |
| 2345 |
#| " exit(EXIT_FAILURE);\n" |
| 2346 |
#| " }\n" |
| 2347 |
#| "\\&\n" |
| 2348 |
#| " return open(mount_path, O_RDONLY);\n" |
| 2349 |
#| "}\n" |
| 2350 |
#| "\\&\n" |
| 2351 |
#| "int\n" |
| 2352 |
#| "main(int argc, char *argv[])\n" |
| 2353 |
#| "{\n" |
| 2354 |
#| " int mount_id, fd, mount_fd, handle_bytes;\n" |
| 2355 |
#| " char buf[1000];\n" |
| 2356 |
#| "#define LINE_SIZE 100\n" |
| 2357 |
#| " char line1[LINE_SIZE], line2[LINE_SIZE];\n" |
| 2358 |
#| " char *nextp;\n" |
| 2359 |
#| " ssize_t nread;\n" |
| 2360 |
#| " struct file_handle *fhp;\n" |
| 2361 |
#| "\\&\n" |
| 2362 |
#| " if ((argc E<gt> 1 && strcmp(argv[1], \"--help\") == 0) || argc E<gt> 2) {\n" |
| 2363 |
#| " fprintf(stderr, \"Usage: %s [mount-path]\\en\", argv[0]);\n" |
| 2364 |
#| " exit(EXIT_FAILURE);\n" |
| 2365 |
#| " }\n" |
| 2366 |
#| "\\&\n" |
| 2367 |
#| " /* Standard input contains mount ID and file handle information:\n" |
| 2368 |
#| "\\&\n" |
| 2369 |
#| " Line 1: E<lt>mount_idE<gt>\n" |
| 2370 |
#| " Line 2: E<lt>handle_bytesE<gt> E<lt>handle_typeE<gt> E<lt>bytes of handle in hexE<gt>\n" |
| 2371 |
#| " */\n" |
| 2372 |
#| "\\&\n" |
| 2373 |
#| " if (fgets(line1, sizeof(line1), stdin) == NULL ||\n" |
| 2374 |
#| " fgets(line2, sizeof(line2), stdin) == NULL)\n" |
| 2375 |
#| " {\n" |
| 2376 |
#| " fprintf(stderr, \"Missing mount_id / file handle\\en\");\n" |
| 2377 |
#| " exit(EXIT_FAILURE);\n" |
| 2378 |
#| " }\n" |
| 2379 |
#| "\\&\n" |
| 2380 |
#| " mount_id = atoi(line1);\n" |
| 2381 |
#| "\\&\n" |
| 2382 |
#| " handle_bytes = strtoul(line2, &nextp, 0);\n" |
| 2383 |
#| "\\&\n" |
| 2384 |
#| " /* Given handle_bytes, we can now allocate file_handle structure. */\n" |
| 2385 |
#| "\\&\n" |
| 2386 |
#| " fhp = malloc(sizeof(*fhp) + handle_bytes);\n" |
| 2387 |
#| " if (fhp == NULL)\n" |
| 2388 |
#| " err(EXIT_FAILURE, \"malloc\");\n" |
| 2389 |
#| "\\&\n" |
| 2390 |
#| " fhp-E<gt>handle_bytes = handle_bytes;\n" |
| 2391 |
#| "\\&\n" |
| 2392 |
#| " fhp-E<gt>handle_type = strtoul(nextp, &nextp, 0);\n" |
| 2393 |
#| "\\&\n" |
| 2394 |
#| " for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n" |
| 2395 |
#| " fhp-E<gt>f_handle[j] = strtoul(nextp, &nextp, 16);\n" |
| 2396 |
#| "\\&\n" |
| 2397 |
#| " /* Obtain file descriptor for mount point, either by opening\n" |
| 2398 |
#| " the pathname specified on the command line, or by scanning\n" |
| 2399 |
#| " /proc/self/mounts to find a mount that matches the \\[aq]mount_id\\[aq]\n" |
| 2400 |
#| " that we received from stdin. */\n" |
| 2401 |
#| "\\&\n" |
| 2402 |
#| " if (argc E<gt> 1)\n" |
| 2403 |
#| " mount_fd = open(argv[1], O_RDONLY);\n" |
| 2404 |
#| " else\n" |
| 2405 |
#| " mount_fd = open_mount_path_by_id(mount_id);\n" |
| 2406 |
#| "\\&\n" |
| 2407 |
#| " if (mount_fd == -1)\n" |
| 2408 |
#| " err(EXIT_FAILURE, \"opening mount fd\");\n" |
| 2409 |
#| "\\&\n" |
| 2410 |
#| " /* Open file using handle and mount point. */\n" |
| 2411 |
#| "\\&\n" |
| 2412 |
#| " fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n" |
| 2413 |
#| " if (fd == -1)\n" |
| 2414 |
#| " err(EXIT_FAILURE, \"open_by_handle_at\");\n" |
| 2415 |
#| "\\&\n" |
| 2416 |
#| " /* Try reading a few bytes from the file. */\n" |
| 2417 |
#| "\\&\n" |
| 2418 |
#| " nread = read(fd, buf, sizeof(buf));\n" |
| 2419 |
#| " if (nread == -1)\n" |
| 2420 |
#| " err(EXIT_FAILURE, \"read\");\n" |
| 2421 |
#| "\\&\n" |
| 2422 |
#| " printf(\"Read %zd bytes\\en\", nread);\n" |
| 2423 |
#| "\\&\n" |
| 2424 |
#| " exit(EXIT_SUCCESS);\n" |
| 2425 |
#| "}\n" |
| 2426 |
msgid "" |
| 2427 |
"#define _GNU_SOURCE\n" |
| 2428 |
"#include E<lt>err.hE<gt>\n" |
| 2429 |
"#include E<lt>fcntl.hE<gt>\n" |
| 2430 |
"#include E<lt>limits.hE<gt>\n" |
| 2431 |
"#include E<lt>stdio.hE<gt>\n" |
| 2432 |
"#include E<lt>stdlib.hE<gt>\n" |
| 2433 |
"#include E<lt>string.hE<gt>\n" |
| 2434 |
"#include E<lt>sys/types.hE<gt>\n" |
| 2435 |
"#include E<lt>unistd.hE<gt>\n" |
| 2436 |
"\\&\n" |
| 2437 |
"/* Scan /proc/self/mountinfo to find the line whose mount ID matches\n" |
| 2438 |
" \\[aq]mount_id\\[aq]. (An easier way to do this is to install and use the\n" |
| 2439 |
" \\[aq]libmount\\[aq] library provided by the \\[aq]util-linux\\[aq] project.)\n" |
| 2440 |
" Open the corresponding mount path and return the resulting file\n" |
| 2441 |
" descriptor. */\n" |
| 2442 |
"\\&\n" |
| 2443 |
"static int\n" |
| 2444 |
"open_mount_path_by_id(int mount_id)\n" |
| 2445 |
"{\n" |
| 2446 |
" int mi_mount_id, found;\n" |
| 2447 |
" char mount_path[PATH_MAX];\n" |
| 2448 |
" char *linep;\n" |
| 2449 |
" FILE *fp;\n" |
| 2450 |
" size_t lsize;\n" |
| 2451 |
" ssize_t nread;\n" |
| 2452 |
"\\&\n" |
| 2453 |
" fp = fopen(\"/proc/self/mountinfo\", \"r\");\n" |
| 2454 |
" if (fp == NULL)\n" |
| 2455 |
" err(EXIT_FAILURE, \"fopen\");\n" |
| 2456 |
"\\&\n" |
| 2457 |
" found = 0;\n" |
| 2458 |
" linep = NULL;\n" |
| 2459 |
" while (!found) {\n" |
| 2460 |
" nread = getline(&linep, &lsize, fp);\n" |
| 2461 |
" if (nread == -1)\n" |
| 2462 |
" break;\n" |
| 2463 |
"\\&\n" |
| 2464 |
" nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n" |
| 2465 |
" &mi_mount_id, mount_path);\n" |
| 2466 |
" if (nread != 2) {\n" |
| 2467 |
" fprintf(stderr, \"Bad sscanf()\\[rs]n\");\n" |
| 2468 |
" exit(EXIT_FAILURE);\n" |
| 2469 |
" }\n" |
| 2470 |
"\\&\n" |
| 2471 |
" if (mi_mount_id == mount_id)\n" |
| 2472 |
" found = 1;\n" |
| 2473 |
" }\n" |
| 2474 |
" free(linep);\n" |
| 2475 |
"\\&\n" |
| 2476 |
" fclose(fp);\n" |
| 2477 |
"\\&\n" |
| 2478 |
" if (!found) {\n" |
| 2479 |
" fprintf(stderr, \"Could not find mount point\\[rs]n\");\n" |
| 2480 |
" exit(EXIT_FAILURE);\n" |
| 2481 |
" }\n" |
| 2482 |
"\\&\n" |
| 2483 |
" return open(mount_path, O_RDONLY);\n" |
| 2484 |
"}\n" |
| 2485 |
"\\&\n" |
| 2486 |
"int\n" |
| 2487 |
"main(int argc, char *argv[])\n" |
| 2488 |
"{\n" |
| 2489 |
" int mount_id, fd, mount_fd, handle_bytes;\n" |
| 2490 |
" char buf[1000];\n" |
| 2491 |
"#define LINE_SIZE 100\n" |
| 2492 |
" char line1[LINE_SIZE], line2[LINE_SIZE];\n" |
| 2493 |
" char *nextp;\n" |
| 2494 |
" ssize_t nread;\n" |
| 2495 |
" struct file_handle *fhp;\n" |
| 2496 |
"\\&\n" |
| 2497 |
" if ((argc E<gt> 1 && strcmp(argv[1], \"--help\") == 0) || argc E<gt> 2) {\n" |
| 2498 |
" fprintf(stderr, \"Usage: %s [mount-path]\\[rs]n\", argv[0]);\n" |
| 2499 |
" exit(EXIT_FAILURE);\n" |
| 2500 |
" }\n" |
| 2501 |
"\\&\n" |
| 2502 |
" /* Standard input contains mount ID and file handle information:\n" |
| 2503 |
"\\&\n" |
| 2504 |
" Line 1: E<lt>mount_idE<gt>\n" |
| 2505 |
" Line 2: E<lt>handle_bytesE<gt> E<lt>handle_typeE<gt> E<lt>bytes of handle in hexE<gt>\n" |
| 2506 |
" */\n" |
| 2507 |
"\\&\n" |
| 2508 |
" if (fgets(line1, sizeof(line1), stdin) == NULL ||\n" |
| 2509 |
" fgets(line2, sizeof(line2), stdin) == NULL)\n" |
| 2510 |
" {\n" |
| 2511 |
" fprintf(stderr, \"Missing mount_id / file handle\\[rs]n\");\n" |
| 2512 |
" exit(EXIT_FAILURE);\n" |
| 2513 |
" }\n" |
| 2514 |
"\\&\n" |
| 2515 |
" mount_id = atoi(line1);\n" |
| 2516 |
"\\&\n" |
| 2517 |
" handle_bytes = strtoul(line2, &nextp, 0);\n" |
| 2518 |
"\\&\n" |
| 2519 |
" /* Given handle_bytes, we can now allocate file_handle structure. */\n" |
| 2520 |
"\\&\n" |
| 2521 |
" fhp = malloc(sizeof(*fhp) + handle_bytes);\n" |
| 2522 |
" if (fhp == NULL)\n" |
| 2523 |
" err(EXIT_FAILURE, \"malloc\");\n" |
| 2524 |
"\\&\n" |
| 2525 |
" fhp-E<gt>handle_bytes = handle_bytes;\n" |
| 2526 |
"\\&\n" |
| 2527 |
" fhp-E<gt>handle_type = strtoul(nextp, &nextp, 0);\n" |
| 2528 |
"\\&\n" |
| 2529 |
" for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n" |
| 2530 |
" fhp-E<gt>f_handle[j] = strtoul(nextp, &nextp, 16);\n" |
| 2531 |
"\\&\n" |
| 2532 |
" /* Obtain file descriptor for mount point, either by opening\n" |
| 2533 |
" the pathname specified on the command line, or by scanning\n" |
| 2534 |
" /proc/self/mounts to find a mount that matches the \\[aq]mount_id\\[aq]\n" |
| 2535 |
" that we received from stdin. */\n" |
| 2536 |
"\\&\n" |
| 2537 |
" if (argc E<gt> 1)\n" |
| 2538 |
" mount_fd = open(argv[1], O_RDONLY);\n" |
| 2539 |
" else\n" |
| 2540 |
" mount_fd = open_mount_path_by_id(mount_id);\n" |
| 2541 |
"\\&\n" |
| 2542 |
" if (mount_fd == -1)\n" |
| 2543 |
" err(EXIT_FAILURE, \"opening mount fd\");\n" |
| 2544 |
"\\&\n" |
| 2545 |
" /* Open file using handle and mount point. */\n" |
| 2546 |
"\\&\n" |
| 2547 |
" fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n" |
| 2548 |
" if (fd == -1)\n" |
| 2549 |
" err(EXIT_FAILURE, \"open_by_handle_at\");\n" |
| 2550 |
"\\&\n" |
| 2551 |
" /* Try reading a few bytes from the file. */\n" |
| 2552 |
"\\&\n" |
| 2553 |
" nread = read(fd, buf, sizeof(buf));\n" |
| 2554 |
" if (nread == -1)\n" |
| 2555 |
" err(EXIT_FAILURE, \"read\");\n" |
| 2556 |
"\\&\n" |
| 2557 |
" printf(\"Read %zd bytes\\[rs]n\", nread);\n" |
| 2558 |
"\\&\n" |
| 2559 |
" exit(EXIT_SUCCESS);\n" |
| 2560 |
"}\n" |
| 2561 |
msgstr "" |
| 2562 |
"#define _GNU_SOURCE\n" |
| 2563 |
"#include E<lt>err.hE<gt>\n" |
| 2564 |
"#include E<lt>fcntl.hE<gt>\n" |
| 2565 |
"#include E<lt>limits.hE<gt>\n" |
| 2566 |
"#include E<lt>stdio.hE<gt>\n" |
| 2567 |
"#include E<lt>stdlib.hE<gt>\n" |
| 2568 |
"#include E<lt>string.hE<gt>\n" |
| 2569 |
"#include E<lt>unistd.hE<gt>\n" |
| 2570 |
"\\&\n" |
| 2571 |
"/* Parcourt /proc/self/mountinfo pour trouver la ligne correspondant à \n" |
| 2572 |
" l'ID de montage \\[aq]mount_id\\[aq]. (Une méthode plus simple consiste à\n" |
| 2573 |
" installer et à utiliser la bibliothèque (\\[aq]libmount\\[aq] fournie par\n" |
| 2574 |
" le projet \\[aq]util-linux\\[aq].) Ouvre le point de montage correspondant\n" |
| 2575 |
" et renvoie le descripteur de fichier associé. */\n" |
| 2576 |
"\\&\n" |
| 2577 |
"static int\n" |
| 2578 |
"open_mount_path_by_id(int mount_id)\n" |
| 2579 |
"{\n" |
| 2580 |
" int mi_mount_id, found;\n" |
| 2581 |
" char mount_path[PATH_MAX];\n" |
| 2582 |
" char *linep;\n" |
| 2583 |
" FILE *fp;\n" |
| 2584 |
" size_t lsize;\n" |
| 2585 |
" ssize_t nread;\n" |
| 2586 |
"\\&\n" |
| 2587 |
" fp = fopen(\"/proc/self/mountinfo\", \"r\");\n" |
| 2588 |
" if (fp == NULL)\n" |
| 2589 |
" err(EXIT_FAILURE, \"fopen\");\n" |
| 2590 |
"\\&\n" |
| 2591 |
" found = 0;\n" |
| 2592 |
" linep = NULL;\n" |
| 2593 |
" while (!found) {\n" |
| 2594 |
" nread = getline(&linep, &lsize, fp);\n" |
| 2595 |
" if (nread == -1)\n" |
| 2596 |
" break;\n" |
| 2597 |
"\\&\n" |
| 2598 |
" nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n" |
| 2599 |
" &mi_mount_id, mount_path);\n" |
| 2600 |
" if (nread != 2) {\n" |
| 2601 |
" fprintf(stderr, \"Mauvais sscanf()\\en\");\n" |
| 2602 |
" exit(EXIT_FAILURE);\n" |
| 2603 |
" }\n" |
| 2604 |
"\\&\n" |
| 2605 |
" if (mi_mount_id == mount_id)\n" |
| 2606 |
" found = 1;\n" |
| 2607 |
" }\n" |
| 2608 |
" free(linep);\n" |
| 2609 |
"\\&\n" |
| 2610 |
" fclose(fp);\n" |
| 2611 |
"\\&\n" |
| 2612 |
" if (!found) {\n" |
| 2613 |
" fprintf(stderr, \"Point de montage non trouvé\\en\");\n" |
| 2614 |
" exit(EXIT_FAILURE);\n" |
| 2615 |
" }\n" |
| 2616 |
"\\&\n" |
| 2617 |
" return open(mount_path, O_RDONLY);\n" |
| 2618 |
"}\n" |
| 2619 |
"\\&\n" |
| 2620 |
"int\n" |
| 2621 |
"main(int argc, char *argv[])\n" |
| 2622 |
"{\n" |
| 2623 |
" int mount_id, fd, mount_fd, handle_bytes;\n" |
| 2624 |
" char buf[1000];\n" |
| 2625 |
"#define LINE_SIZE 100\n" |
| 2626 |
" char line1[LINE_SIZE], line2[LINE_SIZE];\n" |
| 2627 |
" char *nextp;\n" |
| 2628 |
" ssize_t nread;\n" |
| 2629 |
" struct file_handle *fhp;\n" |
| 2630 |
"\\&\n" |
| 2631 |
" if ((argc E<gt> 1 && strcmp(argv[1], \"--help\") == 0) || argc E<gt> 2) {\n" |
| 2632 |
" fprintf(stderr, \"Utilisation : %s [mount-path]\\en\", argv[0]);\n" |
| 2633 |
" exit(EXIT_FAILURE);\n" |
| 2634 |
" }\n" |
| 2635 |
"\\&\n" |
| 2636 |
" /* L'entrée standard contient l'identifiant de montage et\n" |
| 2637 |
" les informations de l'indicateur :\n" |
| 2638 |
"\\&\n" |
| 2639 |
" Ligne 1 : E<lt>mount_idE<gt>\n" |
| 2640 |
" Ligne 2 : E<lt>handle_bytesE<gt> E<lt>handle_typeE<gt> E<lt>octets du descripteur en hexadécimalE<gt>\n" |
| 2641 |
"\\&\n" |
| 2642 |
" if (fgets(line1, sizeof(line1), stdin) == NULL ||\n" |
| 2643 |
" fgets(line2, sizeof(line2), stdin) == NULL)\n" |
| 2644 |
" {\n" |
| 2645 |
" fprintf(stderr, \"mount_id ou descripteur de fichier absent\\en\");\n" |
| 2646 |
" exit(EXIT_FAILURE);\n" |
| 2647 |
" }\n" |
| 2648 |
"\\&\n" |
| 2649 |
" mount_id = atoi(line1);\n" |
| 2650 |
"\\&\n" |
| 2651 |
" handle_bytes = strtoul(line2, &nextp, 0);\n" |
| 2652 |
"\\&\n" |
| 2653 |
" /* handle_bytes étant connu, on peut maintenant allouer la structure\n" |
| 2654 |
" file_handle. */\n" |
| 2655 |
"\\&\n" |
| 2656 |
" fhp = malloc(sizeof(*fhp) + handle_bytes);\n" |
| 2657 |
" if (fhp == NULL)\n" |
| 2658 |
" err(EXIT_FAILURE, \"malloc\");\n" |
| 2659 |
"\\&\n" |
| 2660 |
" fhp-E<gt>handle_bytes = handle_bytes;\n" |
| 2661 |
"\\&\n" |
| 2662 |
" fhp-E<gt>handle_type = strtoul(nextp, &nextp, 0);\n" |
| 2663 |
"\\&\n" |
| 2664 |
" for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n" |
| 2665 |
" fhp-E<gt>f_handle[j] = strtoul(nextp, &nextp, 16);\n" |
| 2666 |
"\\&\n" |
| 2667 |
" /* Récupère le descripteur de fichier du point de montage, soit en ouvrant\n" |
| 2668 |
" le chemin indiqué dans la ligne de commande, soit en parcourant\n" |
| 2669 |
" /proc/self/mounts pour retrouver un montage qui corresponde à\n" |
| 2670 |
" \\[aq]mount_id\\[aq] qui a été reçu de stdin. */\n" |
| 2671 |
"\\&\n" |
| 2672 |
" if (argc E<gt> 1)\n" |
| 2673 |
" mount_fd = open(argv[1], O_RDONLY);\n" |
| 2674 |
" else\n" |
| 2675 |
" mount_fd = open_mount_path_by_id(mount_id);\n" |
| 2676 |
"\\&\n" |
| 2677 |
" if (mount_fd == -1)\n" |
| 2678 |
" err(EXIT_FAILURE, \"opening mount fd\");\n" |
| 2679 |
"\\&\n" |
| 2680 |
" /* Ouvre le fichier en utilisant l'indicateur et le point de montage. */\n" |
| 2681 |
"\\&\n" |
| 2682 |
" fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n" |
| 2683 |
" if (fd == -1)\n" |
| 2684 |
" err(EXIT_FAILURE, \"open_by_handle_at\");\n" |
| 2685 |
"\\&\n" |
| 2686 |
" /* On essaie de lire quelques octets depuis le fichier. */\n" |
| 2687 |
"\\&\n" |
| 2688 |
" nread = read(fd, buf, sizeof(buf));\n" |
| 2689 |
" if (nread == -1)\n" |
| 2690 |
" err(EXIT_FAILURE, \"read\");\n" |
| 2691 |
"\\&\n" |
| 2692 |
" printf(\"Lire %zd octets\\en\", nread);\n" |
| 2693 |
"\\&\n" |
| 2694 |
" exit(EXIT_SUCCESS);\n" |
| 2695 |
"}\n" |
| 2696 |
|
| 2697 |
#. type: Plain text |
| 2698 |
#: debian-trixie fedora-44 fedora-rawhide |
| 2699 |
msgid "" |
| 2700 |
"The I<libblkid> and I<libmount> documentation in the latest I<util-linux> " |
| 2701 |
"release at E<.UR https://www.kernel.org/pub/linux/utils/util-linux/> E<.UE>" |
| 2702 |
msgstr "" |
| 2703 |
"La documentation relative à I<libblkid> et à I<libmount> de la dernière " |
| 2704 |
"publication de I<util-linux> à E<.UR https://www.kernel.org/pub/linux/utils/" |
| 2705 |
"util-linux/> E<.UE>" |
| 2706 |
|
| 2707 |
#. type: TH |
| 2708 |
#: fedora-44 fedora-rawhide |
| 2709 |
#, no-wrap |
| 2710 |
msgid "2024-07-23" |
| 2711 |
msgstr "23 juillet 2024" |
| 2712 |
|
| 2713 |
#. type: TH |
| 2714 |
#: fedora-44 fedora-rawhide |
| 2715 |
#, no-wrap |
| 2716 |
msgid "Linux man-pages 6.13" |
| 2717 |
msgstr "Pages du manuel de Linux 6.13" |
| 2718 |
|
| 2719 |
#. type: TH |
| 2720 |
#: mageia-cauldron |
| 2721 |
#, no-wrap |
| 2722 |
msgid "2026-02-08" |
| 2723 |
msgstr "8 février 2026" |
| 2724 |
|
| 2725 |
#. type: TH |
| 2726 |
#: mageia-cauldron |
| 2727 |
#, no-wrap |
| 2728 |
msgid "Linux man-pages 6.17" |
| 2729 |
msgstr "Pages du manuel de Linux 6.17" |
| 2730 |
|
| 2731 |
#. type: Plain text |
| 2732 |
#: mageia-cauldron |
| 2733 |
#, fuzzy, no-wrap |
| 2734 |
#| msgid "" |
| 2735 |
#| "#define _GNU_SOURCE\n" |
| 2736 |
#| "#include E<lt>err.hE<gt>\n" |
| 2737 |
#| "#include E<lt>fcntl.hE<gt>\n" |
| 2738 |
#| "#include E<lt>limits.hE<gt>\n" |
| 2739 |
#| "#include E<lt>stdio.hE<gt>\n" |
| 2740 |
#| "#include E<lt>stdlib.hE<gt>\n" |
| 2741 |
#| "#include E<lt>string.hE<gt>\n" |
| 2742 |
#| "#include E<lt>unistd.hE<gt>\n" |
| 2743 |
#| "\\&\n" |
| 2744 |
#| "/* Scan /proc/self/mountinfo to find the line whose mount ID matches\n" |
| 2745 |
#| " \\[aq]mount_id\\[aq]. (An easier way to do this is to install and use the\n" |
| 2746 |
#| " \\[aq]libmount\\[aq] library provided by the \\[aq]util-linux\\[aq] project.)\n" |
| 2747 |
#| " Open the corresponding mount path and return the resulting file\n" |
| 2748 |
#| " descriptor. */\n" |
| 2749 |
#| "\\&\n" |
| 2750 |
#| "static int\n" |
| 2751 |
#| "open_mount_path_by_id(int mount_id)\n" |
| 2752 |
#| "{\n" |
| 2753 |
#| " int mi_mount_id, found;\n" |
| 2754 |
#| " char mount_path[PATH_MAX];\n" |
| 2755 |
#| " char *linep;\n" |
| 2756 |
#| " FILE *fp;\n" |
| 2757 |
#| " size_t lsize;\n" |
| 2758 |
#| " ssize_t nread;\n" |
| 2759 |
#| "\\&\n" |
| 2760 |
#| " fp = fopen(\"/proc/self/mountinfo\", \"r\");\n" |
| 2761 |
#| " if (fp == NULL)\n" |
| 2762 |
#| " err(EXIT_FAILURE, \"fopen\");\n" |
| 2763 |
#| "\\&\n" |
| 2764 |
#| " found = 0;\n" |
| 2765 |
#| " linep = NULL;\n" |
| 2766 |
#| " while (!found) {\n" |
| 2767 |
#| " nread = getline(&linep, &lsize, fp);\n" |
| 2768 |
#| " if (nread == -1)\n" |
| 2769 |
#| " break;\n" |
| 2770 |
#| "\\&\n" |
| 2771 |
#| " nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n" |
| 2772 |
#| " &mi_mount_id, mount_path);\n" |
| 2773 |
#| " if (nread != 2) {\n" |
| 2774 |
#| " fprintf(stderr, \"Bad sscanf()\\en\");\n" |
| 2775 |
#| " exit(EXIT_FAILURE);\n" |
| 2776 |
#| " }\n" |
| 2777 |
#| "\\&\n" |
| 2778 |
#| " if (mi_mount_id == mount_id)\n" |
| 2779 |
#| " found = 1;\n" |
| 2780 |
#| " }\n" |
| 2781 |
#| " free(linep);\n" |
| 2782 |
#| "\\&\n" |
| 2783 |
#| " fclose(fp);\n" |
| 2784 |
#| "\\&\n" |
| 2785 |
#| " if (!found) {\n" |
| 2786 |
#| " fprintf(stderr, \"Could not find mount point\\en\");\n" |
| 2787 |
#| " exit(EXIT_FAILURE);\n" |
| 2788 |
#| " }\n" |
| 2789 |
#| "\\&\n" |
| 2790 |
#| " return open(mount_path, O_RDONLY);\n" |
| 2791 |
#| "}\n" |
| 2792 |
#| "\\&\n" |
| 2793 |
#| "int\n" |
| 2794 |
#| "main(int argc, char *argv[])\n" |
| 2795 |
#| "{\n" |
| 2796 |
#| " int mount_id, fd, mount_fd, handle_bytes;\n" |
| 2797 |
#| " char buf[1000];\n" |
| 2798 |
#| "#define LINE_SIZE 100\n" |
| 2799 |
#| " char line1[LINE_SIZE], line2[LINE_SIZE];\n" |
| 2800 |
#| " char *nextp;\n" |
| 2801 |
#| " ssize_t nread;\n" |
| 2802 |
#| " struct file_handle *fhp;\n" |
| 2803 |
#| "\\&\n" |
| 2804 |
#| " if ((argc E<gt> 1 && strcmp(argv[1], \"--help\") == 0) || argc E<gt> 2) {\n" |
| 2805 |
#| " fprintf(stderr, \"Usage: %s [mount-path]\\en\", argv[0]);\n" |
| 2806 |
#| " exit(EXIT_FAILURE);\n" |
| 2807 |
#| " }\n" |
| 2808 |
#| "\\&\n" |
| 2809 |
#| " /* Standard input contains mount ID and file handle information:\n" |
| 2810 |
#| "\\&\n" |
| 2811 |
#| " Line 1: E<lt>mount_idE<gt>\n" |
| 2812 |
#| " Line 2: E<lt>handle_bytesE<gt> E<lt>handle_typeE<gt> E<lt>bytes of handle in hexE<gt>\n" |
| 2813 |
#| " */\n" |
| 2814 |
#| "\\&\n" |
| 2815 |
#| " if (fgets(line1, sizeof(line1), stdin) == NULL ||\n" |
| 2816 |
#| " fgets(line2, sizeof(line2), stdin) == NULL)\n" |
| 2817 |
#| " {\n" |
| 2818 |
#| " fprintf(stderr, \"Missing mount_id / file handle\\en\");\n" |
| 2819 |
#| " exit(EXIT_FAILURE);\n" |
| 2820 |
#| " }\n" |
| 2821 |
#| "\\&\n" |
| 2822 |
#| " mount_id = atoi(line1);\n" |
| 2823 |
#| "\\&\n" |
| 2824 |
#| " handle_bytes = strtoul(line2, &nextp, 0);\n" |
| 2825 |
#| "\\&\n" |
| 2826 |
#| " /* Given handle_bytes, we can now allocate file_handle structure. */\n" |
| 2827 |
#| "\\&\n" |
| 2828 |
#| " fhp = malloc(sizeof(*fhp) + handle_bytes);\n" |
| 2829 |
#| " if (fhp == NULL)\n" |
| 2830 |
#| " err(EXIT_FAILURE, \"malloc\");\n" |
| 2831 |
#| "\\&\n" |
| 2832 |
#| " fhp-E<gt>handle_bytes = handle_bytes;\n" |
| 2833 |
#| "\\&\n" |
| 2834 |
#| " fhp-E<gt>handle_type = strtoul(nextp, &nextp, 0);\n" |
| 2835 |
#| "\\&\n" |
| 2836 |
#| " for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n" |
| 2837 |
#| " fhp-E<gt>f_handle[j] = strtoul(nextp, &nextp, 16);\n" |
| 2838 |
#| "\\&\n" |
| 2839 |
#| " /* Obtain file descriptor for mount point, either by opening\n" |
| 2840 |
#| " the pathname specified on the command line, or by scanning\n" |
| 2841 |
#| " /proc/self/mounts to find a mount that matches the \\[aq]mount_id\\[aq]\n" |
| 2842 |
#| " that we received from stdin. */\n" |
| 2843 |
#| "\\&\n" |
| 2844 |
#| " if (argc E<gt> 1)\n" |
| 2845 |
#| " mount_fd = open(argv[1], O_RDONLY);\n" |
| 2846 |
#| " else\n" |
| 2847 |
#| " mount_fd = open_mount_path_by_id(mount_id);\n" |
| 2848 |
#| "\\&\n" |
| 2849 |
#| " if (mount_fd == -1)\n" |
| 2850 |
#| " err(EXIT_FAILURE, \"opening mount fd\");\n" |
| 2851 |
#| "\\&\n" |
| 2852 |
#| " /* Open file using handle and mount point. */\n" |
| 2853 |
#| "\\&\n" |
| 2854 |
#| " fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n" |
| 2855 |
#| " if (fd == -1)\n" |
| 2856 |
#| " err(EXIT_FAILURE, \"open_by_handle_at\");\n" |
| 2857 |
#| "\\&\n" |
| 2858 |
#| " /* Try reading a few bytes from the file. */\n" |
| 2859 |
#| "\\&\n" |
| 2860 |
#| " nread = read(fd, buf, sizeof(buf));\n" |
| 2861 |
#| " if (nread == -1)\n" |
| 2862 |
#| " err(EXIT_FAILURE, \"read\");\n" |
| 2863 |
#| "\\&\n" |
| 2864 |
#| " printf(\"Read %zd bytes\\en\", nread);\n" |
| 2865 |
#| "\\&\n" |
| 2866 |
#| " exit(EXIT_SUCCESS);\n" |
| 2867 |
#| "}\n" |
| 2868 |
msgid "" |
| 2869 |
"#define _GNU_SOURCE\n" |
| 2870 |
"#include E<lt>err.hE<gt>\n" |
| 2871 |
"#include E<lt>fcntl.hE<gt>\n" |
| 2872 |
"#include E<lt>limits.hE<gt>\n" |
| 2873 |
"#include E<lt>stdio.hE<gt>\n" |
| 2874 |
"#include E<lt>stdlib.hE<gt>\n" |
| 2875 |
"#include E<lt>string.hE<gt>\n" |
| 2876 |
"#include E<lt>sys/types.hE<gt>\n" |
| 2877 |
"#include E<lt>unistd.hE<gt>\n" |
| 2878 |
"\\&\n" |
| 2879 |
"/* Scan /proc/self/mountinfo to find the line whose mount ID matches\n" |
| 2880 |
" \\[aq]mount_id\\[aq]. (An easier way to do this is to install and use the\n" |
| 2881 |
" \\[aq]libmount\\[aq] library provided by the \\[aq]util-linux\\[aq] project.)\n" |
| 2882 |
" Open the corresponding mount path and return the resulting file\n" |
| 2883 |
" descriptor. */\n" |
| 2884 |
"\\&\n" |
| 2885 |
"static int\n" |
| 2886 |
"open_mount_path_by_id(int mount_id)\n" |
| 2887 |
"{\n" |
| 2888 |
" int mi_mount_id, found;\n" |
| 2889 |
" char mount_path[PATH_MAX];\n" |
| 2890 |
" char *linep;\n" |
| 2891 |
" FILE *fp;\n" |
| 2892 |
" size_t lsize;\n" |
| 2893 |
" ssize_t nread;\n" |
| 2894 |
"\\&\n" |
| 2895 |
" fp = fopen(\"/proc/self/mountinfo\", \"r\");\n" |
| 2896 |
" if (fp == NULL)\n" |
| 2897 |
" err(EXIT_FAILURE, \"fopen\");\n" |
| 2898 |
"\\&\n" |
| 2899 |
" found = 0;\n" |
| 2900 |
" linep = NULL;\n" |
| 2901 |
" while (!found) {\n" |
| 2902 |
" nread = getline(&linep, &lsize, fp);\n" |
| 2903 |
" if (nread == -1)\n" |
| 2904 |
" break;\n" |
| 2905 |
"\\&\n" |
| 2906 |
" nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n" |
| 2907 |
" &mi_mount_id, mount_path);\n" |
| 2908 |
" if (nread != 2) {\n" |
| 2909 |
" fprintf(stderr, \"Bad sscanf()\\[rs]n\");\n" |
| 2910 |
" exit(EXIT_FAILURE);\n" |
| 2911 |
" }\n" |
| 2912 |
"\\&\n" |
| 2913 |
" if (mi_mount_id == mount_id)\n" |
| 2914 |
" found = 1;\n" |
| 2915 |
" }\n" |
| 2916 |
" free(linep);\n" |
| 2917 |
"\\&\n" |
| 2918 |
" fclose(fp);\n" |
| 2919 |
"\\&\n" |
| 2920 |
" if (!found) {\n" |
| 2921 |
" fprintf(stderr, \"Could not find mount point\\[rs]n\");\n" |
| 2922 |
" exit(EXIT_FAILURE);\n" |
| 2923 |
" }\n" |
| 2924 |
"\\&\n" |
| 2925 |
" return open(mount_path, O_RDONLY);\n" |
| 2926 |
"}\n" |
| 2927 |
"\\&\n" |
| 2928 |
"int\n" |
| 2929 |
"main(int argc, char *argv[])\n" |
| 2930 |
"{\n" |
| 2931 |
" int mount_id, fd, mount_fd, handle_bytes;\n" |
| 2932 |
" char buf[1000];\n" |
| 2933 |
"#define LINE_SIZE 100\n" |
| 2934 |
" char line1[LINE_SIZE], line2[LINE_SIZE];\n" |
| 2935 |
" char *nextp;\n" |
| 2936 |
" ssize_t nread;\n" |
| 2937 |
" struct file_handle *fhp;\n" |
| 2938 |
"\\&\n" |
| 2939 |
" if ((argc E<gt> 1 && strcmp(argv[1], \"--help\") == 0) || argc E<gt> 2) {\n" |
| 2940 |
" fprintf(stderr, \"Usage: %s [mount-path]\\[rs]n\", argv[0]);\n" |
| 2941 |
" exit(EXIT_FAILURE);\n" |
| 2942 |
" }\n" |
| 2943 |
"\\&\n" |
| 2944 |
" /* Standard input contains mount ID and file handle information:\n" |
| 2945 |
"\\&\n" |
| 2946 |
" Line 1: E<lt>mount_idE<gt>\n" |
| 2947 |
" Line 2: E<lt>handle_bytesE<gt> E<lt>handle_typeE<gt> E<lt>bytes of handle in hexE<gt>\n" |
| 2948 |
" */\n" |
| 2949 |
"\\&\n" |
| 2950 |
" if (fgets(line1, sizeof(line1), stdin) == NULL ||\n" |
| 2951 |
" fgets(line2, sizeof(line2), stdin) == NULL)\n" |
| 2952 |
" {\n" |
| 2953 |
" fprintf(stderr, \"Missing mount_id / file handle\\[rs]n\");\n" |
| 2954 |
" exit(EXIT_FAILURE);\n" |
| 2955 |
" }\n" |
| 2956 |
"\\&\n" |
| 2957 |
" mount_id = atoi(line1);\n" |
| 2958 |
"\\&\n" |
| 2959 |
" handle_bytes = strtoul(line2, &nextp, 0);\n" |
| 2960 |
"\\&\n" |
| 2961 |
" /* Given handle_bytes, we can now allocate file_handle structure. */\n" |
| 2962 |
"\\&\n" |
| 2963 |
" fhp = malloc(sizeof(*fhp) + handle_bytes);\n" |
| 2964 |
" if (fhp == NULL)\n" |
| 2965 |
" err(EXIT_FAILURE, \"malloc\");\n" |
| 2966 |
"\\&\n" |
| 2967 |
" fhp-E<gt>handle_bytes = handle_bytes;\n" |
| 2968 |
"\\&\n" |
| 2969 |
" fhp-E<gt>handle_type = strtoul(nextp, &nextp, 0);\n" |
| 2970 |
"\\&\n" |
| 2971 |
" for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n" |
| 2972 |
" fhp-E<gt>f_handle[j] = strtoul(nextp, &nextp, 16);\n" |
| 2973 |
"\\&\n" |
| 2974 |
" /* Obtain file descriptor for mount point, either by opening\n" |
| 2975 |
" the pathname specified on the command line, or by scanning\n" |
| 2976 |
" /proc/self/mounts to find a mount that matches the \\[aq]mount_id\\[aq]\n" |
| 2977 |
" that we received from stdin. */\n" |
| 2978 |
"\\&\n" |
| 2979 |
" if (argc E<gt> 1)\n" |
| 2980 |
" mount_fd = open(argv[1], O_RDONLY);\n" |
| 2981 |
" else\n" |
| 2982 |
" mount_fd = open_mount_path_by_id(mount_id);\n" |
| 2983 |
"\\&\n" |
| 2984 |
" if (mount_fd == -1)\n" |
| 2985 |
" err(EXIT_FAILURE, \"opening mount fd\");\n" |
| 2986 |
"\\&\n" |
| 2987 |
" /* Open file using handle and mount point. */\n" |
| 2988 |
"\\&\n" |
| 2989 |
" fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n" |
| 2990 |
" if (fd == -1)\n" |
| 2991 |
" err(EXIT_FAILURE, \"open_by_handle_at\");\n" |
| 2992 |
"\\&\n" |
| 2993 |
" /* Try reading a few bytes from the file. */\n" |
| 2994 |
"\\&\n" |
| 2995 |
" nread = read(fd, buf, sizeof(buf));\n" |
| 2996 |
" if (nread == -1)\n" |
| 2997 |
" err(EXIT_FAILURE, \"read\");\n" |
| 2998 |
"\\&\n" |
| 2999 |
" printf(\"Read %zd bytes\\[rs]n\", nread);\n" |
| 3000 |
"\\&\n" |
| 3001 |
" exit(EXIT_SUCCESS);\n" |
| 3002 |
"}\n" |
| 3003 |
msgstr "" |
| 3004 |
"#define _GNU_SOURCE\n" |
| 3005 |
"#include E<lt>err.hE<gt>\n" |
| 3006 |
"#include E<lt>fcntl.hE<gt>\n" |
| 3007 |
"#include E<lt>limits.hE<gt>\n" |
| 3008 |
"#include E<lt>stdio.hE<gt>\n" |
| 3009 |
"#include E<lt>stdlib.hE<gt>\n" |
| 3010 |
"#include E<lt>string.hE<gt>\n" |
| 3011 |
"#include E<lt>unistd.hE<gt>\n" |
| 3012 |
"\\&\n" |
| 3013 |
"/* Parcourt /proc/self/mountinfo pour trouver la ligne correspondant à \n" |
| 3014 |
" l'ID de montage \\[aq]mount_id\\[aq]. (Une méthode plus simple consiste à\n" |
| 3015 |
" installer et à utiliser la bibliothèque (\\[aq]libmount\\[aq] fournie par\n" |
| 3016 |
" le projet \\[aq]util-linux\\[aq].) Ouvre le point de montage correspondant\n" |
| 3017 |
" et renvoie le descripteur de fichier associé. */\n" |
| 3018 |
"\\&\n" |
| 3019 |
"static int\n" |
| 3020 |
"open_mount_path_by_id(int mount_id)\n" |
| 3021 |
"{\n" |
| 3022 |
" int mi_mount_id, found;\n" |
| 3023 |
" char mount_path[PATH_MAX];\n" |
| 3024 |
" char *linep;\n" |
| 3025 |
" FILE *fp;\n" |
| 3026 |
" size_t lsize;\n" |
| 3027 |
" ssize_t nread;\n" |
| 3028 |
"\\&\n" |
| 3029 |
" fp = fopen(\"/proc/self/mountinfo\", \"r\");\n" |
| 3030 |
" if (fp == NULL)\n" |
| 3031 |
" err(EXIT_FAILURE, \"fopen\");\n" |
| 3032 |
"\\&\n" |
| 3033 |
" found = 0;\n" |
| 3034 |
" linep = NULL;\n" |
| 3035 |
" while (!found) {\n" |
| 3036 |
" nread = getline(&linep, &lsize, fp);\n" |
| 3037 |
" if (nread == -1)\n" |
| 3038 |
" break;\n" |
| 3039 |
"\\&\n" |
| 3040 |
" nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n" |
| 3041 |
" &mi_mount_id, mount_path);\n" |
| 3042 |
" if (nread != 2) {\n" |
| 3043 |
" fprintf(stderr, \"Mauvais sscanf()\\en\");\n" |
| 3044 |
" exit(EXIT_FAILURE);\n" |
| 3045 |
" }\n" |
| 3046 |
"\\&\n" |
| 3047 |
" if (mi_mount_id == mount_id)\n" |
| 3048 |
" found = 1;\n" |
| 3049 |
" }\n" |
| 3050 |
" free(linep);\n" |
| 3051 |
"\\&\n" |
| 3052 |
" fclose(fp);\n" |
| 3053 |
"\\&\n" |
| 3054 |
" if (!found) {\n" |
| 3055 |
" fprintf(stderr, \"Point de montage non trouvé\\en\");\n" |
| 3056 |
" exit(EXIT_FAILURE);\n" |
| 3057 |
" }\n" |
| 3058 |
"\\&\n" |
| 3059 |
" return open(mount_path, O_RDONLY);\n" |
| 3060 |
"}\n" |
| 3061 |
"\\&\n" |
| 3062 |
"int\n" |
| 3063 |
"main(int argc, char *argv[])\n" |
| 3064 |
"{\n" |
| 3065 |
" int mount_id, fd, mount_fd, handle_bytes;\n" |
| 3066 |
" char buf[1000];\n" |
| 3067 |
"#define LINE_SIZE 100\n" |
| 3068 |
" char line1[LINE_SIZE], line2[LINE_SIZE];\n" |
| 3069 |
" char *nextp;\n" |
| 3070 |
" ssize_t nread;\n" |
| 3071 |
" struct file_handle *fhp;\n" |
| 3072 |
"\\&\n" |
| 3073 |
" if ((argc E<gt> 1 && strcmp(argv[1], \"--help\") == 0) || argc E<gt> 2) {\n" |
| 3074 |
" fprintf(stderr, \"Utilisation : %s [mount-path]\\en\", argv[0]);\n" |
| 3075 |
" exit(EXIT_FAILURE);\n" |
| 3076 |
" }\n" |
| 3077 |
"\\&\n" |
| 3078 |
" /* L'entrée standard contient l'identifiant de montage et\n" |
| 3079 |
" les informations de l'indicateur :\n" |
| 3080 |
"\\&\n" |
| 3081 |
" Ligne 1 : E<lt>mount_idE<gt>\n" |
| 3082 |
" Ligne 2 : E<lt>handle_bytesE<gt> E<lt>handle_typeE<gt> E<lt>octets du descripteur en hexadécimalE<gt>\n" |
| 3083 |
"\\&\n" |
| 3084 |
" if (fgets(line1, sizeof(line1), stdin) == NULL ||\n" |
| 3085 |
" fgets(line2, sizeof(line2), stdin) == NULL)\n" |
| 3086 |
" {\n" |
| 3087 |
" fprintf(stderr, \"mount_id ou descripteur de fichier absent\\en\");\n" |
| 3088 |
" exit(EXIT_FAILURE);\n" |
| 3089 |
" }\n" |
| 3090 |
"\\&\n" |
| 3091 |
" mount_id = atoi(line1);\n" |
| 3092 |
"\\&\n" |
| 3093 |
" handle_bytes = strtoul(line2, &nextp, 0);\n" |
| 3094 |
"\\&\n" |
| 3095 |
" /* handle_bytes étant connu, on peut maintenant allouer la structure\n" |
| 3096 |
" file_handle. */\n" |
| 3097 |
"\\&\n" |
| 3098 |
" fhp = malloc(sizeof(*fhp) + handle_bytes);\n" |
| 3099 |
" if (fhp == NULL)\n" |
| 3100 |
" err(EXIT_FAILURE, \"malloc\");\n" |
| 3101 |
"\\&\n" |
| 3102 |
" fhp-E<gt>handle_bytes = handle_bytes;\n" |
| 3103 |
"\\&\n" |
| 3104 |
" fhp-E<gt>handle_type = strtoul(nextp, &nextp, 0);\n" |
| 3105 |
"\\&\n" |
| 3106 |
" for (size_t j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n" |
| 3107 |
" fhp-E<gt>f_handle[j] = strtoul(nextp, &nextp, 16);\n" |
| 3108 |
"\\&\n" |
| 3109 |
" /* Récupère le descripteur de fichier du point de montage, soit en ouvrant\n" |
| 3110 |
" le chemin indiqué dans la ligne de commande, soit en parcourant\n" |
| 3111 |
" /proc/self/mounts pour retrouver un montage qui corresponde à\n" |
| 3112 |
" \\[aq]mount_id\\[aq] qui a été reçu de stdin. */\n" |
| 3113 |
"\\&\n" |
| 3114 |
" if (argc E<gt> 1)\n" |
| 3115 |
" mount_fd = open(argv[1], O_RDONLY);\n" |
| 3116 |
" else\n" |
| 3117 |
" mount_fd = open_mount_path_by_id(mount_id);\n" |
| 3118 |
"\\&\n" |
| 3119 |
" if (mount_fd == -1)\n" |
| 3120 |
" err(EXIT_FAILURE, \"opening mount fd\");\n" |
| 3121 |
"\\&\n" |
| 3122 |
" /* Ouvre le fichier en utilisant l'indicateur et le point de montage. */\n" |
| 3123 |
"\\&\n" |
| 3124 |
" fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n" |
| 3125 |
" if (fd == -1)\n" |
| 3126 |
" err(EXIT_FAILURE, \"open_by_handle_at\");\n" |
| 3127 |
"\\&\n" |
| 3128 |
" /* On essaie de lire quelques octets depuis le fichier. */\n" |
| 3129 |
"\\&\n" |
| 3130 |
" nread = read(fd, buf, sizeof(buf));\n" |
| 3131 |
" if (nread == -1)\n" |
| 3132 |
" err(EXIT_FAILURE, \"read\");\n" |
| 3133 |
"\\&\n" |
| 3134 |
" printf(\"Lire %zd octets\\en\", nread);\n" |
| 3135 |
"\\&\n" |
| 3136 |
" exit(EXIT_SUCCESS);\n" |
| 3137 |
"}\n" |
| 3138 |
|
| 3139 |
#. type: TH |
| 3140 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 3141 |
#, no-wrap |
| 3142 |
msgid "Linux man-pages (unreleased)" |
| 3143 |
msgstr "Pages du manuel de Linux (non publiées)" |