Debian Codegraph @

po/fr/man2/pivot_root.2.po

raw
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, 2013-2014.
16 # Denis Barbier <[email protected]>, 2006, 2010.
17 # David Prévot <[email protected]>, 2010-2014.
18 # Jean-Philippe MENGUAL <[email protected]>, 2021-2024.
19 msgid ""
20 msgstr ""
21 "Project-Id-Version: manpages-l10n 4.22.0\n"
22 "POT-Creation-Date: 2026-06-05 06:35+0200\n"
23 "PO-Revision-Date: 2024-04-17 18:15+0200\n"
24 "Last-Translator: Jean-Philippe MENGUAL <[email protected]>\n"
25 "Language-Team: French <[email protected]>\n"
26 "Language: fr\n"
27 "MIME-Version: 1.0\n"
28 "Content-Type: text/plain; charset=UTF-8\n"
29 "Content-Transfer-Encoding: 8bit\n"
30 "Plural-Forms: nplurals=2; plural=n > 1;\n"
31 "X-Generator: Lokalize 22.12.1\n"
32
33 #. type: TH
34 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
35 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
36 #, no-wrap
37 msgid "pivot_root"
38 msgstr "pivot_root"
39
40 #. type: TH
41 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
42 #: opensuse-tumbleweed
43 #, no-wrap
44 msgid "2026-02-08"
45 msgstr "8 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 "pivot_root - change the root mount"
64 msgstr "pivot_root - Modifier le montage racine"
65
66 #. type: SH
67 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
68 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
69 #, no-wrap
70 msgid "LIBRARY"
71 msgstr "BIBLIOTHÈQUE"
72
73 #. type: Plain text
74 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
75 #: opensuse-leap-16-1 opensuse-tumbleweed
76 msgid "Standard C library (I<libc>,\\ I<-lc>)"
77 msgstr "Bibliothèque C standard (I<libc>,\\ I<-lc>)"
78
79 #. type: SH
80 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
81 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
82 #, no-wrap
83 msgid "SYNOPSIS"
84 msgstr "SYNOPSIS"
85
86 #. type: Plain text
87 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
88 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
89 #, no-wrap
90 msgid ""
91 "B<#include E<lt>sys/syscall.hE<gt>> /* Definition of B<SYS_*> constants */\n"
92 "B<#include E<lt>unistd.hE<gt>>\n"
93 msgstr ""
94 "B<#include E<lt>sys/syscall.hE<gt>> /* Définition des constantes B<SYS_*> */\n"
95 "B<#include E<lt>unistd.hE<gt>>\n"
96
97 #. type: Plain text
98 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
99 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
100 #, no-wrap
101 msgid "B<int syscall(SYS_pivot_root, const char *>I<new_root>B<, const char *>I<put_old>B<);>\n"
102 msgstr "B<int syscall(SYS_pivot_root, const char *>I<new_root>B<, const char *>I<put_old>B<);>\n"
103
104 #. type: Plain text
105 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
106 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
107 msgid ""
108 "I<Note>: glibc provides no wrapper for B<pivot_root>(), necessitating the "
109 "use of B<syscall>(2)."
110 msgstr ""
111 "I<Note>: la glibc ne fournit pas d'enveloppe pour B<pivot_root>(), "
112 "nécessitant l'utilisation de B<syscall>(2)."
113
114 #. type: SH
115 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
116 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
117 #, no-wrap
118 msgid "DESCRIPTION"
119 msgstr "DESCRIPTION"
120
121 #. type: Plain text
122 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
123 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
124 msgid ""
125 "B<pivot_root>() changes the root mount in the mount namespace of the "
126 "calling process. More precisely, it moves the root mount to the directory "
127 "I<put_old> and makes I<new_root> the new root mount. The calling process "
128 "must have the B<CAP_SYS_ADMIN> capability in the user namespace that owns "
129 "the caller's mount namespace."
130 msgstr ""
131 "B<pivot_root>() modifie le montage racine dans l'espace de noms de montage "
132 "du processus appelant. Plus précisément, il déplace le montage racine dans "
133 "le répertoire I<put_old> et il fait de I<new_root> le nouveau montage "
134 "racine. Le processus appelant doit avoir la capacité B<CAP_SYS_ADMIN> dans "
135 "l'espace de noms de l'utilisateur à qui appartient l'espace de noms de "
136 "montage de l'appelant."
137
138 #. type: Plain text
139 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
140 #: opensuse-tumbleweed
141 #, fuzzy
142 #| msgid ""
143 #| "B<pivot_root>() changes the root directory and the current working "
144 #| "directory of each process or thread in the same mount namespace to "
145 #| "I<new_root> if they point to the old root directory. (See also NOTES.) "
146 #| "On the other hand, B<pivot_root>() does not change the caller's current "
147 #| "working directory (unless it is on the old root directory), and thus it "
148 #| "should be followed by a B<chdir(\"/\")> call."
149 msgid ""
150 "B<pivot_root>() changes the root directory and the current working "
151 "directory of each process or thread in the same mount namespace to "
152 "I<new_root> if they point to the old root directory. (See also NOTES.) On "
153 "the other hand, B<pivot_root>() does not change the caller's current "
154 "working directory (unless it is on the old root directory), and thus it "
155 "should be followed by a I<chdir(\"/\")> call."
156 msgstr ""
157 "B<pivot_root>() change le répertoire racine et le répertoire de travail de "
158 "chaque processus ou de chaque thread du même espace de noms de montage en "
159 "I<new_root> s'ils pointent vers l'ancien répertoire de montage (voir aussi "
160 "les NOTES). D'un autre côté, B<pivot_root>() ne modifie pas le répertoire de "
161 "travail de l'appelant (sauf s'il est sur l'ancien répertoire racine), ainsi, "
162 "il doit être suivi d'un appel B<chdir(\"/\")>."
163
164 #. type: Plain text
165 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
166 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
167 msgid "The following restrictions apply:"
168 msgstr "Les restrictions suivantes s'appliquent\\ :"
169
170 #. type: IP
171 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
172 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
173 #, no-wrap
174 msgid "\\[bu]"
175 msgstr "-"
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 msgid "I<new_root> and I<put_old> must be directories."
181 msgstr "I<new_root> et I<put_old> doivent être des répertoires."
182
183 #. type: Plain text
184 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
185 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
186 msgid ""
187 "I<new_root> and I<put_old> must not be on the same mount as the current root."
188 msgstr ""
189 "I<new_root> et I<put_old> ne doivent pas être sur le même montage que la "
190 "racine actuelle."
191
192 #. type: Plain text
193 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
194 #: opensuse-tumbleweed
195 #, fuzzy
196 #| msgid ""
197 #| "I<put_old> must be at or underneath I<new_root>; that is, adding some "
198 #| "nonnegative number of \"I</..>\" suffixes to the pathname pointed to by "
199 #| "I<put_old> must yield the same directory as I<new_root>."
200 msgid ""
201 "I<put_old> must be at or underneath I<new_root>; that is, adding some "
202 "nonnegative number of \\[dq]I</..\\&>\\[dq] suffixes to the pathname pointed "
203 "to by I<put_old> must yield the same directory as I<new_root>."
204 msgstr ""
205 "I<put_old> doit être sur I<new_root> ou un descendant de I<new_root>\\ : à "
206 "savoir qu'ajouter un nombre positif de suffixes « I</..> » au chemin vers "
207 "lequel pointe I<put_old> doit ramener au même répertoire que I<new_root>."
208
209 #. type: Plain text
210 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
211 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
212 msgid ""
213 "I<new_root> must be a path to a mount point, but can't be I<\\[dq]/\\[dq]>. "
214 "A path that is not already a mount point can be converted into one by bind "
215 "mounting the path onto itself."
216 msgstr ""
217 "I<new_root> doit être un chemin vers un point de montage ; mais il ne peut "
218 "pas être « / ». Un chemin qui n'est pas un point de montage peut le devenir "
219 "en montant en miroir le point sur lui-même."
220
221 #. type: Plain text
222 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
223 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
224 msgid ""
225 "The propagation type of the parent mount of I<new_root> and the parent mount "
226 "of the current root directory must not be B<MS_SHARED>; similarly, if "
227 "I<put_old> is an existing mount point, its propagation type must not be "
228 "B<MS_SHARED>. These restrictions ensure that B<pivot_root>() never "
229 "propagates any changes to another mount namespace."
230 msgstr ""
231 "Le type de propagation du montage parent de I<new_root> et le montage parent "
232 "du répertoire racine actuel ne doivent pas être B<MS_SHARED> ; de même, si "
233 "I<put_old> est un point de montage existant, son type de propagation ne doit "
234 "pas être B<MS_SHARED>. Ces restrictions garantissent que B<pivot_root>() ne "
235 "propage jamais de changement sur un autre espace de noms de montage."
236
237 #. type: Plain text
238 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
239 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
240 msgid "The current root directory must be a mount point."
241 msgstr "Le répertoire racine actuel doit être un point de montage."
242
243 #. type: SH
244 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
245 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
246 #, no-wrap
247 msgid "RETURN VALUE"
248 msgstr "VALEUR RENVOYÉE"
249
250 #. type: Plain text
251 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
252 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
253 msgid ""
254 "On success, zero is returned. On error, -1 is returned, and I<errno> is set "
255 "to indicate the error."
256 msgstr ""
257 "En cas de succès, zéro est renvoyé. En cas d'erreur, B<-1> est renvoyé et "
258 "I<errno> est définie pour préciser l'erreur."
259
260 #. type: SH
261 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
262 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
263 #, no-wrap
264 msgid "ERRORS"
265 msgstr "ERREURS"
266
267 #. type: Plain text
268 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
269 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
270 msgid ""
271 "B<pivot_root>() may fail with any of the same errors as B<stat>(2). "
272 "Additionally, it may fail with the following errors:"
273 msgstr ""
274 "B<pivot_root>() peut échouer avec une des erreurs de B<stat>(2). Il peut "
275 "aussi échouer avec les erreurs suivantes\\ :"
276
277 #. type: TP
278 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
279 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
280 #, no-wrap
281 msgid "B<EBUSY>"
282 msgstr "B<EBUSY>"
283
284 #. #-#-#-#-# archlinux: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
285 #. Reconfirmed that the following error occurs on Linux 5.0 by
286 #. specifying 'new_root' as "/rootfs" and 'put_old' as
287 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
288 #. itself. Of course, this is an odd situation, since a later check
289 #. in the kernel code will in any case yield EINVAL if 'new_root' is
290 #. not a mount point. However, when the system call was first added,
291 #. 'new_root' was not required to be a mount point. So, this
292 #. error is nowadays probably just the result of crufty accumulation.
293 #. This error can also occur if we bind mount "/" on top of itself
294 #. and try to specify "/" as the 'new' (again, an odd situation). So,
295 #. the EBUSY check in the kernel does still seem necessary to prevent
296 #. that case. Furthermore, the "or put_old" piece is probably
297 #. redundant text (although the check is in the kernel), since,
298 #. in another check, 'put_old' is required to be under 'new_root'.
299 #. type: Plain text
300 #. #-#-#-#-# debian-trixie: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
301 #. Reconfirmed that the following error occurs on Linux 5.0 by
302 #. specifying 'new_root' as "/rootfs" and 'put_old' as
303 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
304 #. itself. Of course, this is an odd situation, since a later check
305 #. in the kernel code will in any case yield EINVAL if 'new_root' is
306 #. not a mount point. However, when the system call was first added,
307 #. 'new_root' was not required to be a mount point. So, this
308 #. error is nowadays probably just the result of crufty accumulation.
309 #. This error can also occur if we bind mount "/" on top of itself
310 #. and try to specify "/" as the 'new' (again, an odd situation). So,
311 #. the EBUSY check in the kernel does still seem necessary to prevent
312 #. that case. Furthermore, the "or put_old" piece is probably
313 #. redundant text (although the check is in the kernel), since,
314 #. in another check, 'put_old' is required to be under 'new_root'.
315 #. type: Plain text
316 #. #-#-#-#-# debian-unstable: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
317 #. Reconfirmed that the following error occurs on Linux 5.0 by
318 #. specifying 'new_root' as "/rootfs" and 'put_old' as
319 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
320 #. itself. Of course, this is an odd situation, since a later check
321 #. in the kernel code will in any case yield EINVAL if 'new_root' is
322 #. not a mount point. However, when the system call was first added,
323 #. 'new_root' was not required to be a mount point. So, this
324 #. error is nowadays probably just the result of crufty accumulation.
325 #. This error can also occur if we bind mount "/" on top of itself
326 #. and try to specify "/" as the 'new' (again, an odd situation). So,
327 #. the EBUSY check in the kernel does still seem necessary to prevent
328 #. that case. Furthermore, the "or put_old" piece is probably
329 #. redundant text (although the check is in the kernel), since,
330 #. in another check, 'put_old' is required to be under 'new_root'.
331 #. type: Plain text
332 #. #-#-#-#-# fedora-44: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
333 #. Reconfirmed that the following error occurs on Linux 5.0 by
334 #. specifying 'new_root' as "/rootfs" and 'put_old' as
335 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
336 #. itself. Of course, this is an odd situation, since a later check
337 #. in the kernel code will in any case yield EINVAL if 'new_root' is
338 #. not a mount point. However, when the system call was first added,
339 #. 'new_root' was not required to be a mount point. So, this
340 #. error is nowadays probably just the result of crufty accumulation.
341 #. This error can also occur if we bind mount "/" on top of itself
342 #. and try to specify "/" as the 'new' (again, an odd situation). So,
343 #. the EBUSY check in the kernel does still seem necessary to prevent
344 #. that case. Furthermore, the "or put_old" piece is probably
345 #. redundant text (although the check is in the kernel), since,
346 #. in another check, 'put_old' is required to be under 'new_root'.
347 #. type: Plain text
348 #. #-#-#-#-# fedora-rawhide: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
349 #. Reconfirmed that the following error occurs on Linux 5.0 by
350 #. specifying 'new_root' as "/rootfs" and 'put_old' as
351 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
352 #. itself. Of course, this is an odd situation, since a later check
353 #. in the kernel code will in any case yield EINVAL if 'new_root' is
354 #. not a mount point. However, when the system call was first added,
355 #. 'new_root' was not required to be a mount point. So, this
356 #. error is nowadays probably just the result of crufty accumulation.
357 #. This error can also occur if we bind mount "/" on top of itself
358 #. and try to specify "/" as the 'new' (again, an odd situation). So,
359 #. the EBUSY check in the kernel does still seem necessary to prevent
360 #. that case. Furthermore, the "or put_old" piece is probably
361 #. redundant text (although the check is in the kernel), since,
362 #. in another check, 'put_old' is required to be under 'new_root'.
363 #. type: Plain text
364 #. #-#-#-#-# mageia-cauldron: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
365 #. Reconfirmed that the following error occurs on Linux 5.0 by
366 #. specifying 'new_root' as "/rootfs" and 'put_old' as
367 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
368 #. itself. Of course, this is an odd situation, since a later check
369 #. in the kernel code will in any case yield EINVAL if 'new_root' is
370 #. not a mount point. However, when the system call was first added,
371 #. 'new_root' was not required to be a mount point. So, this
372 #. error is nowadays probably just the result of crufty accumulation.
373 #. This error can also occur if we bind mount "/" on top of itself
374 #. and try to specify "/" as the 'new' (again, an odd situation). So,
375 #. the EBUSY check in the kernel does still seem necessary to prevent
376 #. that case. Furthermore, the "or put_old" piece is probably
377 #. redundant text (although the check is in the kernel), since,
378 #. in another check, 'put_old' is required to be under 'new_root'.
379 #. type: Plain text
380 #. #-#-#-#-# opensuse-leap-16-1: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
381 #. Reconfirmed that the following error occurs on Linux 5.0 by
382 #. specifying 'new_root' as "/rootfs" and 'put_old' as
383 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
384 #. itself. Of course, this is an odd situation, since a later check
385 #. in the kernel code will in any case yield EINVAL if 'new_root' is
386 #. not a mount point. However, when the system call was first added,
387 #. 'new_root' was not required to be a mount point. So, this
388 #. error is nowadays probably just the result of crufty accumulation.
389 #. This error can also occur if we bind mount "/" on top of itself
390 #. and try to specify "/" as the 'new' (again, an odd situation). So,
391 #. the EBUSY check in the kernel does still seem necessary to prevent
392 #. that case. Furthermore, the "or put_old" piece is probably
393 #. redundant text (although the check is in the kernel), since,
394 #. in another check, 'put_old' is required to be under 'new_root'.
395 #. type: Plain text
396 #. #-#-#-#-# opensuse-tumbleweed: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
397 #. Reconfirmed that the following error occurs on Linux 5.0 by
398 #. specifying 'new_root' as "/rootfs" and 'put_old' as
399 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
400 #. itself. Of course, this is an odd situation, since a later check
401 #. in the kernel code will in any case yield EINVAL if 'new_root' is
402 #. not a mount point. However, when the system call was first added,
403 #. 'new_root' was not required to be a mount point. So, this
404 #. error is nowadays probably just the result of crufty accumulation.
405 #. This error can also occur if we bind mount "/" on top of itself
406 #. and try to specify "/" as the 'new' (again, an odd situation). So,
407 #. the EBUSY check in the kernel does still seem necessary to prevent
408 #. that case. Furthermore, the "or put_old" piece is probably
409 #. redundant text (although the check is in the kernel), since,
410 #. in another check, 'put_old' is required to be under 'new_root'.
411 #. type: Plain text
412 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
413 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
414 msgid ""
415 "I<new_root> or I<put_old> is on the current root mount. (This error covers "
416 "the pathological case where I<new_root> is I<\\[dq]/\\[dq]>.)"
417 msgstr ""
418 "I<new_root> ou I<put_old> est sur le montage racine actuel (cette erreur "
419 "vaut pour le cas pathologique où I<new_root> est « / »."
420
421 #. type: TP
422 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
423 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
424 #, no-wrap
425 msgid "B<EINVAL>"
426 msgstr "B<EINVAL>"
427
428 #. type: Plain text
429 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
430 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
431 msgid "I<new_root> is not a mount point."
432 msgstr "I<new_root> n'est pas un point de montage."
433
434 #. type: Plain text
435 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
436 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
437 msgid "I<put_old> is not at or underneath I<new_root>."
438 msgstr "I<put_old> n'est pas sur I<new_root> ou un descendant."
439
440 #. type: Plain text
441 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
442 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
443 msgid ""
444 "The current root directory is not a mount point (because of an earlier "
445 "B<chroot>(2))."
446 msgstr ""
447 "Le répertoire racine actuel n'est pas un point de montage (du fait d'un "
448 "précédent B<chroot>(2))."
449
450 #. type: Plain text
451 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
452 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
453 msgid "The current root is on the rootfs (initial ramfs) mount; see NOTES."
454 msgstr ""
455 "La racine actuelle est sur le montage rootfs (ramfs initial) ; voir les "
456 "NOTES."
457
458 #. type: Plain text
459 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
460 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
461 msgid ""
462 "Either the mount point at I<new_root>, or the parent mount of that mount "
463 "point, has propagation type B<MS_SHARED>."
464 msgstr ""
465 "Soit le point de montage sur I<new_root>, soit le montage parent de ce point "
466 "de montage, a un type de propagation B<MS_SHARED>."
467
468 #. type: Plain text
469 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
470 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
471 msgid "I<put_old> is a mount point and has the propagation type B<MS_SHARED>."
472 msgstr ""
473 "I<put_old> est un point de montage et il a le type de propagation "
474 "B<MS_SHARED>."
475
476 #. type: TP
477 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
478 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
479 #, no-wrap
480 msgid "B<ENOTDIR>"
481 msgstr "B<ENOTDIR>"
482
483 #. type: Plain text
484 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
485 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
486 msgid "I<new_root> or I<put_old> is not a directory."
487 msgstr "I<new_root> ou I<put_old> n'est pas un répertoire."
488
489 #. type: TP
490 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
491 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
492 #, no-wrap
493 msgid "B<EPERM>"
494 msgstr "B<EPERM>"
495
496 #. type: Plain text
497 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
498 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
499 msgid "The calling process does not have the B<CAP_SYS_ADMIN> capability."
500 msgstr "Le processus appelant n'a pas la capacité B<CAP_SYS_ADMIN>."
501
502 #. type: SH
503 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
504 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
505 #, no-wrap
506 msgid "STANDARDS"
507 msgstr "NORMES"
508
509 #. type: Plain text
510 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
511 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
512 msgid "Linux."
513 msgstr "Linux."
514
515 #. type: SH
516 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
517 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
518 #, no-wrap
519 msgid "HISTORY"
520 msgstr "HISTORIQUE"
521
522 #. type: Plain text
523 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
524 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
525 msgid "Linux 2.3.41."
526 msgstr "Linux 2.3.41."
527
528 #. type: SH
529 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
530 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
531 #, no-wrap
532 msgid "NOTES"
533 msgstr "NOTES"
534
535 #. type: Plain text
536 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
537 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
538 msgid ""
539 "A command-line interface for this system call is provided by "
540 "B<pivot_root>(8)."
541 msgstr ""
542 "Une interface en ligne de commande pour cet appel système est fournie par "
543 "B<pivot_root>(8)."
544
545 #. type: Plain text
546 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
547 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
548 msgid ""
549 "B<pivot_root>() allows the caller to switch to a new root filesystem while "
550 "at the same time placing the old root mount at a location under I<new_root> "
551 "from where it can subsequently be unmounted. (The fact that it moves all "
552 "processes that have a root directory or current working directory on the old "
553 "root directory to the new root frees the old root directory of users, "
554 "allowing the old root mount to be unmounted more easily.)"
555 msgstr ""
556 "B<pivot_root>() permet à un appelant de passer à un nouveau système de "
557 "fichiers racine tout en mettant l'ancien montage racine dans I<new_root>, "
558 "d'où il peut être démonté (le fait de déplacer tous les processus ayant un "
559 "répertoire racine ou actuel dans le répertoire racine vers une nouvelle "
560 "racine libère l'ancienne racine des utilisateurs, permettant de démonter "
561 "plus facilement l'ancien montage racine)."
562
563 #. type: Plain text
564 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
565 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
566 msgid ""
567 "One use of B<pivot_root>() is during system startup, when the system mounts "
568 "a temporary root filesystem (e.g., an B<initrd>(4)), then mounts the real "
569 "root filesystem, and eventually turns the latter into the root directory of "
570 "all relevant processes and threads. A modern use is to set up a root "
571 "filesystem during the creation of a container."
572 msgstr ""
573 "L'utilisation typique de B<pivot_root>() est durant le démarrage du système, "
574 "lorsque le système monte un système de fichiers temporaire (par exemple un "
575 "B<initrd>(4)) puis monte le véritable système de fichiers et le transforme "
576 "éventuellement en racine pour tous les processus et threads concernés. Une "
577 "utilisation moderne consiste à définir un système de fichiers racine pendant "
578 "la création d'un conteneur."
579
580 #. type: Plain text
581 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
582 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
583 msgid ""
584 "The fact that B<pivot_root>() modifies process root and current working "
585 "directories in the manner noted in DESCRIPTION is necessary in order to "
586 "prevent kernel threads from keeping the old root mount busy with their root "
587 "and current working directories, even if they never access the filesystem in "
588 "any way."
589 msgstr ""
590 "Le fait que B<pivot_root>() modifie les répertoires racine et de travail du "
591 "processus comme indiqué dans la DESCRIPTION est nécessaire afin d'empêcher "
592 "les threads du noyau d'occuper l'ancien montage racine avec leurs "
593 "répertoires racine et de travail, même s'ils n'accèdent jamais au système de "
594 "fichiers en aucune manière."
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 ""
600 "The rootfs (initial ramfs) cannot be B<pivot_root>()ed. The recommended "
601 "method of changing the root filesystem in this case is to delete everything "
602 "in rootfs, overmount rootfs with the new root, attach I<stdin>/I<stdout>/"
603 "I<stderr> to the new I</dev/console>, and exec the new B<init>(1). Helper "
604 "programs for this process exist; see B<switch_root>(8)."
605 msgstr ""
606 "Le rootfs (initial ramfs) ne peut pas être B<pivot_root>()é. La méthode "
607 "recommandée pour modifier le système de fichiers racine dans ce cas consiste "
608 "à tout effacer sur le rootfs, monter par-dessus la nouvelle racine, "
609 "rattacher I<stdin>/I<stdout>/I<stderr> au nouveau I</dev/console> et "
610 "exécuter le nouvel B<init>(1). Il existe des programmes d'aide pour ce "
611 "processus ; voir B<switch_root>(8)."
612
613 #. type: SS
614 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
615 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
616 #, no-wrap
617 msgid "pivot_root(\\[dq].\\[dq], \\[dq].\\[dq])"
618 msgstr "pivot_root(\\[dq].\\[dq], \\[dq].\\[dq])"
619
620 #. type: Plain text
621 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
622 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
623 msgid ""
624 "I<new_root> and I<put_old> may be the same directory. In particular, the "
625 "following sequence allows a pivot-root operation without needing to create "
626 "and remove a temporary directory:"
627 msgstr ""
628 "I<new_root> et I<put_old> peuvent être le même répertoire. En particulier, "
629 "la séquence suivante permet une opération pivot-root sans devoir créer et "
630 "supprimer un répertoire temporaire :"
631
632 #. type: Plain text
633 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
634 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
635 #, no-wrap
636 msgid ""
637 "chdir(new_root);\n"
638 "pivot_root(\".\", \".\");\n"
639 "umount2(\".\", MNT_DETACH);\n"
640 msgstr ""
641 "chdir(new_root);\n"
642 "pivot_root(\".\", \".\");\n"
643 "umount2(\".\", MNT_DETACH);\n"
644
645 #. type: Plain text
646 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
647 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
648 msgid ""
649 "This sequence succeeds because the B<pivot_root>() call stacks the old root "
650 "mount point on top of the new root mount point at I</>. At that point, the "
651 "calling process's root directory and current working directory refer to the "
652 "new root mount point (I<new_root>). During the subsequent B<umount>() "
653 "call, resolution of I<\\[dq].\\[dq]> starts with I<new_root> and then moves "
654 "up the list of mounts stacked at I</>, with the result that old root mount "
655 "point is unmounted."
656 msgstr ""
657 "Cette séquence réussit parce que l'appel B<pivot_root>() place le point de "
658 "montage racine au sommet du nouveau point de montage racine sur I</>. Alors, "
659 "le répertoire racine et celui de travail du processus appelant se rapportent "
660 "au nouveau point de montage racine (I<new_root>). Lors de l'appel "
661 "B<umount>() suivant, la résolution de II<\\[dq].\\[dq]> commence par "
662 "I<new_root> puis monte la liste des points de montage empilés dans I</>, "
663 "d'où il résulte que l'ancien point de montage est démonté."
664
665 #. type: SS
666 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
667 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
668 #, no-wrap
669 msgid "Historical notes"
670 msgstr "Remarques historiques"
671
672 #. type: Plain text
673 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
674 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
675 msgid "For many years, this manual page carried the following text:"
676 msgstr ""
677 "Pendant de nombreuses années, cette page de manuel comportait le texte "
678 "suivant :"
679
680 #. type: Plain text
681 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
682 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
683 msgid ""
684 "B<pivot_root>() may or may not change the current root and the current "
685 "working directory of any processes or threads which use the old root "
686 "directory. The caller of B<pivot_root>() must ensure that processes with "
687 "root or current working directory at the old root operate correctly in "
688 "either case. An easy way to ensure this is to change their root and current "
689 "working directory to I<new_root> before invoking B<pivot_root>()."
690 msgstr ""
691 "B<pivot_root>() peut changer ou non les répertoires racine et de travail en "
692 "cours de tous les processus et threads qui utilisaient l'ancien répertoire "
693 "racine. L'appelant de B<pivot_root>() doit s'assurer que les processus ayant "
694 "pour racine ou répertoire de travail l'ancien répertoire se comportent "
695 "correctement. Le meilleur moyen est de modifier leur répertoire de travail "
696 "et répertoire racine pour I<new_root> avant d'invoquer B<pivot_root>()."
697
698 #. type: Plain text
699 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
700 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
701 msgid ""
702 "This text, written before the system call implementation was even finalized "
703 "in the kernel, was probably intended to warn users at that time that the "
704 "implementation might change before final release. However, the behavior "
705 "stated in DESCRIPTION has remained consistent since this system call was "
706 "first implemented and will not change now."
707 msgstr ""
708 "Ce texte, écrit avant même la finalisation de l'implémentation de l'appel "
709 "système dans le noyau, visait sans doute à avertir les utilisateurs à ce "
710 "moment là que l'implémentation pourrait changer avant la publication "
711 "définitive. Toutefois, le comportement indiqué dans DESCRIPTION est resté "
712 "valable depuis la première implémentation de cet appel système et il ne "
713 "changera pas maintenant."
714
715 #. type: SH
716 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
717 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
718 #, no-wrap
719 msgid "EXAMPLES"
720 msgstr "EXEMPLES"
721
722 #. FIXME
723 #. Would it be better, because simpler, to use unshare(2)
724 #. rather than clone(2) in the example below?
725 #. type: Plain text
726 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
727 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
728 msgid ""
729 "The program below demonstrates the use of B<pivot_root>() inside a mount "
730 "namespace that is created using B<clone>(2). After pivoting to the root "
731 "directory named in the program's first command-line argument, the child "
732 "created by B<clone>(2) then executes the program named in the remaining "
733 "command-line arguments."
734 msgstr ""
735 "Le programme ci-dessous montre l'utilisation de B<pivot_root>() dans un "
736 "espace de noms de montage créé en utilisant B<clone>(2). Après avoir changé "
737 "le répertoire racine appelé dans le premier paramètre de la ligne de "
738 "commande du programme, l'enfant créé par B<clone>(2) exécute alors le "
739 "programme nommé dans les autres paramètres de la ligne de commande."
740
741 #. type: Plain text
742 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
743 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
744 msgid ""
745 "We demonstrate the program by creating a directory that will serve as the "
746 "new root filesystem and placing a copy of the (statically linked) "
747 "B<busybox>(1) executable in that directory."
748 msgstr ""
749 "Nous montrons le programme en créant un répertoire qui servira de nouveau "
750 "système de fichiers racine et en mettant une copie de l'exécutable "
751 "B<busybox>(1) (liée statiquement) dans ce répertoire."
752
753 #. type: Plain text
754 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
755 #: opensuse-tumbleweed
756 #, fuzzy, no-wrap
757 #| msgid ""
758 #| "$ B<mkdir /tmp/rootfs>\n"
759 #| "$ B<ls -id /tmp/rootfs> # Show inode number of new root directory\n"
760 #| "319459 /tmp/rootfs\n"
761 #| "$ B<cp $(which busybox) /tmp/rootfs>\n"
762 #| "$ B<PS1=\\[aq]bbsh$ \\[aq] sudo ./pivot_root_demo /tmp/rootfs /busybox sh>\n"
763 #| "bbsh$ B<PATH=/>\n"
764 #| "bbsh$ B<busybox ln busybox ln>\n"
765 #| "bbsh$ B<ln busybox echo>\n"
766 #| "bbsh$ B<ln busybox ls>\n"
767 #| "bbsh$ B<ls>\n"
768 #| "busybox echo ln ls\n"
769 #| "bbsh$ B<ls -id /> # Compare with inode number above\n"
770 #| "319459 /\n"
771 #| "bbsh$ B<echo \\[aq]hello world\\[aq]>\n"
772 #| "hello world\n"
773 msgid ""
774 "$B< mkdir /tmp/rootfs>;\n"
775 "$B< ls -id /tmp/rootfs>; # Show inode number of new root directory\n"
776 "319459 /tmp/rootfs\n"
777 "$B< cp $(which busybox) /tmp/rootfs>;\n"
778 "$B< PS1=\\[aq]bbsh$ \\[aq] sudo ./pivot_root_demo /tmp/rootfs /busybox sh>;\n"
779 "bbsh$B< PATH=/>;\n"
780 "bbsh$B< busybox ln busybox ln>;\n"
781 "bbsh$B< ln busybox echo>;\n"
782 "bbsh$B< ln busybox ls>;\n"
783 "bbsh$B< ls>;\n"
784 "busybox echo ln ls\n"
785 "bbsh$B< ls -id />; # Compare with inode number above\n"
786 "319459 /\n"
787 "bbsh$B< echo \\[aq]hello world\\[aq]>;\n"
788 "hello world\n"
789 msgstr ""
790 "$ B<mkdir /tmp/rootfs>\n"
791 "$ B<ls -id /tmp/rootfs> # Numéro d’inœud dans le nouveau répertoire racine\n"
792 "319459 /tmp/rootfs\n"
793 "$ B<cp $(which busybox) /tmp/rootfs>\n"
794 "$ B<PS1=\\[aq]bbsh$ \\[aq] sudo ./pivot_root_demo /tmp/rootfs /busybox sh>\n"
795 "bbsh$ B<PATH=/>\n"
796 "bbsh$ B<busybox ln busybox ln>\n"
797 "bbsh$ B<ln busybox echo>\n"
798 "bbsh$ B<ln busybox ls>\n"
799 "bbsh$ B<ls>\n"
800 "busybox echo ln ls\n"
801 "bbsh$ B<ls -id /> # Comparaison avec le numéro d’inœud au-dessus\n"
802 "319459 /\n"
803 "bbsh$ B<echo \\[aq]hello world\\[aq]>\n"
804 "hello world\n"
805
806 #. type: SS
807 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
808 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
809 #, no-wrap
810 msgid "Program source"
811 msgstr "Source du programme"
812
813 #. type: Plain text
814 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
815 #: opensuse-tumbleweed
816 #, fuzzy, no-wrap
817 #| msgid ""
818 #| "/* pivot_root_demo.c */\n"
819 #| "\\&\n"
820 #| "#define _GNU_SOURCE\n"
821 #| "#include E<lt>err.hE<gt>\n"
822 #| "#include E<lt>limits.hE<gt>\n"
823 #| "#include E<lt>sched.hE<gt>\n"
824 #| "#include E<lt>signal.hE<gt>\n"
825 #| "#include E<lt>stdio.hE<gt>\n"
826 #| "#include E<lt>stdlib.hE<gt>\n"
827 #| "#include E<lt>sys/mman.hE<gt>\n"
828 #| "#include E<lt>sys/mount.hE<gt>\n"
829 #| "#include E<lt>sys/stat.hE<gt>\n"
830 #| "#include E<lt>sys/syscall.hE<gt>\n"
831 #| "#include E<lt>sys/wait.hE<gt>\n"
832 #| "#include E<lt>unistd.hE<gt>\n"
833 #| "\\&\n"
834 #| "static int\n"
835 #| "pivot_root(const char *new_root, const char *put_old)\n"
836 #| "{\n"
837 #| " return syscall(SYS_pivot_root, new_root, put_old);\n"
838 #| "}\n"
839 #| "\\&\n"
840 #| "#define STACK_SIZE (1024 * 1024)\n"
841 #| "\\&\n"
842 #| "static int /* Startup function for cloned child */\n"
843 #| "child(void *arg)\n"
844 #| "{\n"
845 #| " char path[PATH_MAX];\n"
846 #| " char **args = arg;\n"
847 #| " char *new_root = args[0];\n"
848 #| " const char *put_old = \"/oldrootfs\";\n"
849 #| "\\&\n"
850 #| " /* Ensure that \\[aq]new_root\\[aq] and its parent mount don\\[aq]t have\n"
851 #| " shared propagation (which would cause pivot_root() to\n"
852 #| " return an error), and prevent propagation of mount\n"
853 #| " events to the initial mount namespace. */\n"
854 #| "\\&\n"
855 #| " if (mount(NULL, \"/\", NULL, MS_REC | MS_PRIVATE, NULL) == -1)\n"
856 #| " err(EXIT_FAILURE, \"mount-MS_PRIVATE\");\n"
857 #| "\\&\n"
858 #| " /* Ensure that \\[aq]new_root\\[aq] is a mount point. */\n"
859 #| "\\&\n"
860 #| " if (mount(new_root, new_root, NULL, MS_BIND, NULL) == -1)\n"
861 #| " err(EXIT_FAILURE, \"mount-MS_BIND\");\n"
862 #| "\\&\n"
863 #| " /* Create directory to which old root will be pivoted. */\n"
864 #| "\\&\n"
865 #| " snprintf(path, sizeof(path), \"%s/%s\", new_root, put_old);\n"
866 #| " if (mkdir(path, 0777) == -1)\n"
867 #| " err(EXIT_FAILURE, \"mkdir\");\n"
868 #| "\\&\n"
869 #| " /* And pivot the root filesystem. */\n"
870 #| "\\&\n"
871 #| " if (pivot_root(new_root, path) == -1)\n"
872 #| " err(EXIT_FAILURE, \"pivot_root\");\n"
873 #| "\\&\n"
874 #| " /* Switch the current working directory to \"/\". */\n"
875 #| "\\&\n"
876 #| " if (chdir(\"/\") == -1)\n"
877 #| " err(EXIT_FAILURE, \"chdir\");\n"
878 #| "\\&\n"
879 #| " /* Unmount old root and remove mount point. */\n"
880 #| "\\&\n"
881 #| " if (umount2(put_old, MNT_DETACH) == -1)\n"
882 #| " perror(\"umount2\");\n"
883 #| " if (rmdir(put_old) == -1)\n"
884 #| " perror(\"rmdir\");\n"
885 #| "\\&\n"
886 #| " /* Execute the command specified in argv[1]... */\n"
887 #| "\\&\n"
888 #| " execv(args[1], &args[1]);\n"
889 #| " err(EXIT_FAILURE, \"execv\");\n"
890 #| "}\n"
891 #| "\\&\n"
892 #| "int\n"
893 #| "main(int argc, char *argv[])\n"
894 #| "{\n"
895 #| " char *stack;\n"
896 #| "\\&\n"
897 #| " /* Create a child process in a new mount namespace. */\n"
898 #| "\\&\n"
899 #| " stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE,\n"
900 #| " MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);\n"
901 #| " if (stack == MAP_FAILED)\n"
902 #| " err(EXIT_FAILURE, \"mmap\");\n"
903 #| "\\&\n"
904 #| " if (clone(child, stack + STACK_SIZE,\n"
905 #| " CLONE_NEWNS | SIGCHLD, &argv[1]) == -1)\n"
906 #| " err(EXIT_FAILURE, \"clone\");\n"
907 #| "\\&\n"
908 #| " /* Parent falls through to here; wait for child. */\n"
909 #| "\\&\n"
910 #| " if (wait(NULL) == -1)\n"
911 #| " err(EXIT_FAILURE, \"wait\");\n"
912 #| "\\&\n"
913 #| " exit(EXIT_SUCCESS);\n"
914 #| "}\n"
915 msgid ""
916 "/* pivot_root_demo.c */\n"
917 "\\&\n"
918 "#define _GNU_SOURCE\n"
919 "#include E<lt>err.hE<gt>\n"
920 "#include E<lt>limits.hE<gt>\n"
921 "#include E<lt>sched.hE<gt>\n"
922 "#include E<lt>signal.hE<gt>\n"
923 "#include E<lt>stdio.hE<gt>\n"
924 "#include E<lt>stdlib.hE<gt>\n"
925 "#include E<lt>sys/mman.hE<gt>\n"
926 "#include E<lt>sys/mount.hE<gt>\n"
927 "#include E<lt>sys/stat.hE<gt>\n"
928 "#include E<lt>sys/syscall.hE<gt>\n"
929 "#include E<lt>sys/wait.hE<gt>\n"
930 "#include E<lt>unistd.hE<gt>\n"
931 "\\&\n"
932 "static int\n"
933 "pivot_root(const char *new_root, const char *put_old)\n"
934 "{\n"
935 " return syscall(SYS_pivot_root, new_root, put_old);\n"
936 "}\n"
937 "\\&\n"
938 "#define STACK_SIZE (1024 * 1024)\n"
939 "\\&\n"
940 "static int /* Startup function for cloned child */\n"
941 "child(void *arg)\n"
942 "{\n"
943 " char path[PATH_MAX];\n"
944 " char **args = arg;\n"
945 " char *new_root = args[0];\n"
946 " const char *put_old = \"/oldrootfs\";\n"
947 "\\&\n"
948 " /* Ensure that \\[aq]new_root\\[aq] and its parent mount don\\[aq]t have\n"
949 " shared propagation (which would cause pivot_root() to\n"
950 " return an error), and prevent propagation of mount\n"
951 " events to the initial mount namespace. */\n"
952 "\\&\n"
953 " if (mount(NULL, \"/\", NULL, MS_REC | MS_PRIVATE, NULL) == -1)\n"
954 " err(EXIT_FAILURE, \"mount-MS_PRIVATE\");\n"
955 "\\&\n"
956 " /* Ensure that \\[aq]new_root\\[aq] is a mount point. */\n"
957 "\\&\n"
958 " if (mount(new_root, new_root, NULL, MS_BIND, NULL) == -1)\n"
959 " err(EXIT_FAILURE, \"mount-MS_BIND\");\n"
960 "\\&\n"
961 " /* Create directory to which old root will be pivoted. */\n"
962 "\\&\n"
963 " snprintf(path, sizeof(path), \"%s/%s\", new_root, put_old);\n"
964 " if (mkdir(path, 0777) == -1)\n"
965 " err(EXIT_FAILURE, \"mkdir\");\n"
966 "\\&\n"
967 " /* And pivot the root filesystem. */\n"
968 "\\&\n"
969 " if (pivot_root(new_root, path) == -1)\n"
970 " err(EXIT_FAILURE, \"pivot_root\");\n"
971 "\\&\n"
972 " /* Switch the current working directory to \"/\". */\n"
973 "\\&\n"
974 " if (chdir(\"/\") == -1)\n"
975 " err(EXIT_FAILURE, \"chdir\");\n"
976 "\\&\n"
977 " /* Unmount old root and remove mount point. */\n"
978 "\\&\n"
979 " if (umount2(put_old, MNT_DETACH) == -1)\n"
980 " perror(\"umount2\");\n"
981 " if (rmdir(put_old) == -1)\n"
982 " perror(\"rmdir\");\n"
983 "\\&\n"
984 " /* Execute the command specified in argv[1]... */\n"
985 "\\&\n"
986 " execv(args[1], &args[1]);\n"
987 " err(EXIT_FAILURE, \"execv\");\n"
988 "}\n"
989 "\\&\n"
990 "int\n"
991 "main(int argc, char *argv[])\n"
992 "{\n"
993 " char *stack;\n"
994 "\\&\n"
995 " /* Create a child process in a new mount namespace. */\n"
996 "\\&\n"
997 " stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE,\n"
998 " MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);\n"
999 " if (stack == MAP_FAILED)\n"
1000 " err(EXIT_FAILURE, \"mmap\");\n"
1001 "\\&\n"
1002 " if (clone(child, stack + STACK_SIZE,\n"
1003 " CLONE_NEWNS | SIGCHLD, &argv[1]) == -1)\n"
1004 " err(EXIT_FAILURE, \"clone\");\n"
1005 "\\&\n"
1006 " /* Parent falls through to here; wait for child. */\n"
1007 "\\&\n"
1008 " if (wait(NULL) == -1)\n"
1009 " err(EXIT_FAILURE, \"wait\");\n"
1010 "\\&\n"
1011 " exit(EXIT_SUCCESS);\n"
1012 "}\n"
1013 msgstr ""
1014 "/* pivot_root_demo.c */\n"
1015 "\\&\n"
1016 "#define _GNU_SOURCE\n"
1017 "#include E<lt>err.hE<gt>\n"
1018 "#include E<lt>limits.hE<gt>\n"
1019 "#include E<lt>sched.hE<gt>\n"
1020 "#include E<lt>signal.hE<gt>\n"
1021 "#include E<lt>stdio.hE<gt>\n"
1022 "#include E<lt>stdlib.hE<gt>\n"
1023 "#include E<lt>sys/mman.hE<gt>\n"
1024 "#include E<lt>sys/mount.hE<gt>\n"
1025 "#include E<lt>sys/stat.hE<gt>\n"
1026 "#include E<lt>sys/syscall.hE<gt>\n"
1027 "#include E<lt>sys/wait.hE<gt>\n"
1028 "#include E<lt>unistd.hE<gt>\n"
1029 "\\&\n"
1030 "static int\n"
1031 "pivot_root(const char *new_root, const char *put_old)\n"
1032 "{\n"
1033 " return syscall(SYS_pivot_root, new_root, put_old);\n"
1034 "}\n"
1035 "\\&\n"
1036 "#define STACK_SIZE (1024 * 1024)\n"
1037 "\\&\n"
1038 "static int /* Fonction de démarrage pour l’enfant cloné */\n"
1039 "child(void *arg)\n"
1040 "{\n"
1041 " char path[PATH_MAX];\n"
1042 " char **args = arg;\n"
1043 " char *new_root = args[0];\n"
1044 " const char *put_old = \"/oldrootfs\";\n"
1045 "\\&\n"
1046 " /* S'assurer que \\[aq]new_root\\[aq] et son point de montage parent\n"
1047 " n’aient pas une propagation partagée (ce qui ferait renvoyer une\n"
1048 " erreur à pivot_root()) et empêcher la propagation des événements\n"
1049 " de montage dans l'espace de noms de montage initial. */\n"
1050 "\\&\n"
1051 " if (mount(NULL, \"/\", NULL, MS_REC | MS_PRIVATE, NULL) == -1)\n"
1052 " err(EXIT_FAILURE, \"mount-MS_PRIVATE\");\n"
1053 "\\&\n"
1054 " /* S'assurer que \\[aq]new_root\\[aq] soit un point de montage. */\n"
1055 "\\&\n"
1056 " if (mount(new_root, new_root, NULL, MS_BIND, NULL) == -1)\n"
1057 " err(EXIT_FAILURE, \"mount-MS_BIND\");\n"
1058 "\\&\n"
1059 " /* Créer le répertoire où l'ancienne racine sera envoyée. */\n"
1060 "\\&\n"
1061 " snprintf(path, sizeof(path), \"%s/%s\", new_root, put_old);\n"
1062 " if (mkdir(path, 0777) == -1)\n"
1063 " err(EXIT_FAILURE, \"mkdir\");\n"
1064 "\\&\n"
1065 " /* Et changer de système de fichiers racine. */\n"
1066 "\\&\n"
1067 " if (pivot_root(new_root, path) == -1)\n"
1068 " err(EXIT_FAILURE, \"pivot_root\");\n"
1069 "\\&\n"
1070 " /* Déplacer le répertoire de travail dans \"/\". */\n"
1071 "\\&\n"
1072 " if (chdir(\"/\") == -1)\n"
1073 " err(EXIT_FAILURE, \"chdir\");\n"
1074 "\\&\n"
1075 " /* Démonter l'ancienne racine et supprimer le point de montage. */\n"
1076 "\\&\n"
1077 " if (umount2(put_old, MNT_DETACH) == -1)\n"
1078 " perror(\"umount2\");\n"
1079 " if (rmdir(put_old) == -1)\n"
1080 " perror(\"rmdir\");\n"
1081 "\\&\n"
1082 " /* Exécuter la commande indiquée dans argv[1]... */\n"
1083 "\\&\n"
1084 " execv(args[1], &args[1]);\n"
1085 " err(EXIT_FAILURE, \"execv\");\n"
1086 "}\n"
1087 "\\&\n"
1088 "int\n"
1089 "main(int argc, char *argv[])\n"
1090 "{\n"
1091 " char *stack;\n"
1092 "\\&\n"
1093 " /* Créer un processus enfant dans un nouvel espace de noms de montage. */\n"
1094 "\\&\n"
1095 " stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE,\n"
1096 " MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);\n"
1097 " if (stack == MAP_FAILED)\n"
1098 " err(EXIT_FAILURE, \"mmap\");\n"
1099 "\\&\n"
1100 " if (clone(child, stack + STACK_SIZE,\n"
1101 " CLONE_NEWNS | SIGCHLD, &argv[1]) == -1)\n"
1102 " err(EXIT_FAILURE, \"clone\");\n"
1103 "\\&\n"
1104 " /* Le parent arrive ici ; attendre l'enfant. */\n"
1105 "\\&\n"
1106 " if (wait(NULL) == -1)\n"
1107 " err(EXIT_FAILURE, \"wait\");\n"
1108 "\\&\n"
1109 " exit(EXIT_SUCCESS);\n"
1110 "}\n"
1111
1112 #. SRC END
1113 #. type: SH
1114 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1115 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1116 #, no-wrap
1117 msgid "SEE ALSO"
1118 msgstr "VOIR AUSSI"
1119
1120 #. type: Plain text
1121 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1122 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1123 msgid ""
1124 "B<chdir>(2), B<chroot>(2), B<mount>(2), B<stat>(2), B<initrd>(4), "
1125 "B<mount_namespaces>(7), B<pivot_root>(8), B<switch_root>(8)"
1126 msgstr ""
1127 "B<chdir>(2), B<chroot>(2), B<mount>(2), B<stat>(2), B<initrd>(4), "
1128 "B<mount_namespaces>(7), B<pivot_root>(8), B<switch_root>(8)"
1129
1130 #. type: TH
1131 #: debian-trixie
1132 #, no-wrap
1133 msgid "2024-05-02"
1134 msgstr "2 mai 2024"
1135
1136 #. type: TH
1137 #: debian-trixie
1138 #, no-wrap
1139 msgid "Linux man-pages 6.9.1"
1140 msgstr "Pages du manuel de Linux 6.9.1"
1141
1142 #. type: Plain text
1143 #: debian-trixie
1144 msgid "Standard C library (I<libc>, I<-lc>)"
1145 msgstr "Bibliothèque C standard (I<libc>, I<-lc>)"
1146
1147 #. type: Plain text
1148 #: debian-trixie fedora-44 fedora-rawhide
1149 msgid ""
1150 "B<pivot_root>() changes the root directory and the current working "
1151 "directory of each process or thread in the same mount namespace to "
1152 "I<new_root> if they point to the old root directory. (See also NOTES.) On "
1153 "the other hand, B<pivot_root>() does not change the caller's current "
1154 "working directory (unless it is on the old root directory), and thus it "
1155 "should be followed by a B<chdir(\"/\")> call."
1156 msgstr ""
1157 "B<pivot_root>() change le répertoire racine et le répertoire de travail de "
1158 "chaque processus ou de chaque thread du même espace de noms de montage en "
1159 "I<new_root> s'ils pointent vers l'ancien répertoire de montage (voir aussi "
1160 "les NOTES). D'un autre côté, B<pivot_root>() ne modifie pas le répertoire de "
1161 "travail de l'appelant (sauf s'il est sur l'ancien répertoire racine), ainsi, "
1162 "il doit être suivi d'un appel B<chdir(\"/\")>."
1163
1164 #. type: Plain text
1165 #: debian-trixie fedora-44 fedora-rawhide
1166 msgid ""
1167 "I<put_old> must be at or underneath I<new_root>; that is, adding some "
1168 "nonnegative number of \"I</..>\" suffixes to the pathname pointed to by "
1169 "I<put_old> must yield the same directory as I<new_root>."
1170 msgstr ""
1171 "I<put_old> doit être sur I<new_root> ou un descendant de I<new_root>\\ : à "
1172 "savoir qu'ajouter un nombre positif de suffixes « I</..> » au chemin vers "
1173 "lequel pointe I<put_old> doit ramener au même répertoire que I<new_root>."
1174
1175 #. type: Plain text
1176 #: debian-trixie fedora-44 fedora-rawhide
1177 #, no-wrap
1178 msgid ""
1179 "$ B<mkdir /tmp/rootfs>\n"
1180 "$ B<ls -id /tmp/rootfs> # Show inode number of new root directory\n"
1181 "319459 /tmp/rootfs\n"
1182 "$ B<cp $(which busybox) /tmp/rootfs>\n"
1183 "$ B<PS1=\\[aq]bbsh$ \\[aq] sudo ./pivot_root_demo /tmp/rootfs /busybox sh>\n"
1184 "bbsh$ B<PATH=/>\n"
1185 "bbsh$ B<busybox ln busybox ln>\n"
1186 "bbsh$ B<ln busybox echo>\n"
1187 "bbsh$ B<ln busybox ls>\n"
1188 "bbsh$ B<ls>\n"
1189 "busybox echo ln ls\n"
1190 "bbsh$ B<ls -id /> # Compare with inode number above\n"
1191 "319459 /\n"
1192 "bbsh$ B<echo \\[aq]hello world\\[aq]>\n"
1193 "hello world\n"
1194 msgstr ""
1195 "$ B<mkdir /tmp/rootfs>\n"
1196 "$ B<ls -id /tmp/rootfs> # Numéro d’inœud dans le nouveau répertoire racine\n"
1197 "319459 /tmp/rootfs\n"
1198 "$ B<cp $(which busybox) /tmp/rootfs>\n"
1199 "$ B<PS1=\\[aq]bbsh$ \\[aq] sudo ./pivot_root_demo /tmp/rootfs /busybox sh>\n"
1200 "bbsh$ B<PATH=/>\n"
1201 "bbsh$ B<busybox ln busybox ln>\n"
1202 "bbsh$ B<ln busybox echo>\n"
1203 "bbsh$ B<ln busybox ls>\n"
1204 "bbsh$ B<ls>\n"
1205 "busybox echo ln ls\n"
1206 "bbsh$ B<ls -id /> # Comparaison avec le numéro d’inœud au-dessus\n"
1207 "319459 /\n"
1208 "bbsh$ B<echo \\[aq]hello world\\[aq]>\n"
1209 "hello world\n"
1210
1211 #. type: Plain text
1212 #: debian-trixie fedora-44 fedora-rawhide
1213 #, no-wrap
1214 msgid ""
1215 "/* pivot_root_demo.c */\n"
1216 "\\&\n"
1217 "#define _GNU_SOURCE\n"
1218 "#include E<lt>err.hE<gt>\n"
1219 "#include E<lt>limits.hE<gt>\n"
1220 "#include E<lt>sched.hE<gt>\n"
1221 "#include E<lt>signal.hE<gt>\n"
1222 "#include E<lt>stdio.hE<gt>\n"
1223 "#include E<lt>stdlib.hE<gt>\n"
1224 "#include E<lt>sys/mman.hE<gt>\n"
1225 "#include E<lt>sys/mount.hE<gt>\n"
1226 "#include E<lt>sys/stat.hE<gt>\n"
1227 "#include E<lt>sys/syscall.hE<gt>\n"
1228 "#include E<lt>sys/wait.hE<gt>\n"
1229 "#include E<lt>unistd.hE<gt>\n"
1230 "\\&\n"
1231 "static int\n"
1232 "pivot_root(const char *new_root, const char *put_old)\n"
1233 "{\n"
1234 " return syscall(SYS_pivot_root, new_root, put_old);\n"
1235 "}\n"
1236 "\\&\n"
1237 "#define STACK_SIZE (1024 * 1024)\n"
1238 "\\&\n"
1239 "static int /* Startup function for cloned child */\n"
1240 "child(void *arg)\n"
1241 "{\n"
1242 " char path[PATH_MAX];\n"
1243 " char **args = arg;\n"
1244 " char *new_root = args[0];\n"
1245 " const char *put_old = \"/oldrootfs\";\n"
1246 "\\&\n"
1247 " /* Ensure that \\[aq]new_root\\[aq] and its parent mount don\\[aq]t have\n"
1248 " shared propagation (which would cause pivot_root() to\n"
1249 " return an error), and prevent propagation of mount\n"
1250 " events to the initial mount namespace. */\n"
1251 "\\&\n"
1252 " if (mount(NULL, \"/\", NULL, MS_REC | MS_PRIVATE, NULL) == -1)\n"
1253 " err(EXIT_FAILURE, \"mount-MS_PRIVATE\");\n"
1254 "\\&\n"
1255 " /* Ensure that \\[aq]new_root\\[aq] is a mount point. */\n"
1256 "\\&\n"
1257 " if (mount(new_root, new_root, NULL, MS_BIND, NULL) == -1)\n"
1258 " err(EXIT_FAILURE, \"mount-MS_BIND\");\n"
1259 "\\&\n"
1260 " /* Create directory to which old root will be pivoted. */\n"
1261 "\\&\n"
1262 " snprintf(path, sizeof(path), \"%s/%s\", new_root, put_old);\n"
1263 " if (mkdir(path, 0777) == -1)\n"
1264 " err(EXIT_FAILURE, \"mkdir\");\n"
1265 "\\&\n"
1266 " /* And pivot the root filesystem. */\n"
1267 "\\&\n"
1268 " if (pivot_root(new_root, path) == -1)\n"
1269 " err(EXIT_FAILURE, \"pivot_root\");\n"
1270 "\\&\n"
1271 " /* Switch the current working directory to \"/\". */\n"
1272 "\\&\n"
1273 " if (chdir(\"/\") == -1)\n"
1274 " err(EXIT_FAILURE, \"chdir\");\n"
1275 "\\&\n"
1276 " /* Unmount old root and remove mount point. */\n"
1277 "\\&\n"
1278 " if (umount2(put_old, MNT_DETACH) == -1)\n"
1279 " perror(\"umount2\");\n"
1280 " if (rmdir(put_old) == -1)\n"
1281 " perror(\"rmdir\");\n"
1282 "\\&\n"
1283 " /* Execute the command specified in argv[1]... */\n"
1284 "\\&\n"
1285 " execv(args[1], &args[1]);\n"
1286 " err(EXIT_FAILURE, \"execv\");\n"
1287 "}\n"
1288 "\\&\n"
1289 "int\n"
1290 "main(int argc, char *argv[])\n"
1291 "{\n"
1292 " char *stack;\n"
1293 "\\&\n"
1294 " /* Create a child process in a new mount namespace. */\n"
1295 "\\&\n"
1296 " stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE,\n"
1297 " MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);\n"
1298 " if (stack == MAP_FAILED)\n"
1299 " err(EXIT_FAILURE, \"mmap\");\n"
1300 "\\&\n"
1301 " if (clone(child, stack + STACK_SIZE,\n"
1302 " CLONE_NEWNS | SIGCHLD, &argv[1]) == -1)\n"
1303 " err(EXIT_FAILURE, \"clone\");\n"
1304 "\\&\n"
1305 " /* Parent falls through to here; wait for child. */\n"
1306 "\\&\n"
1307 " if (wait(NULL) == -1)\n"
1308 " err(EXIT_FAILURE, \"wait\");\n"
1309 "\\&\n"
1310 " exit(EXIT_SUCCESS);\n"
1311 "}\n"
1312 msgstr ""
1313 "/* pivot_root_demo.c */\n"
1314 "\\&\n"
1315 "#define _GNU_SOURCE\n"
1316 "#include E<lt>err.hE<gt>\n"
1317 "#include E<lt>limits.hE<gt>\n"
1318 "#include E<lt>sched.hE<gt>\n"
1319 "#include E<lt>signal.hE<gt>\n"
1320 "#include E<lt>stdio.hE<gt>\n"
1321 "#include E<lt>stdlib.hE<gt>\n"
1322 "#include E<lt>sys/mman.hE<gt>\n"
1323 "#include E<lt>sys/mount.hE<gt>\n"
1324 "#include E<lt>sys/stat.hE<gt>\n"
1325 "#include E<lt>sys/syscall.hE<gt>\n"
1326 "#include E<lt>sys/wait.hE<gt>\n"
1327 "#include E<lt>unistd.hE<gt>\n"
1328 "\\&\n"
1329 "static int\n"
1330 "pivot_root(const char *new_root, const char *put_old)\n"
1331 "{\n"
1332 " return syscall(SYS_pivot_root, new_root, put_old);\n"
1333 "}\n"
1334 "\\&\n"
1335 "#define STACK_SIZE (1024 * 1024)\n"
1336 "\\&\n"
1337 "static int /* Fonction de démarrage pour l’enfant cloné */\n"
1338 "child(void *arg)\n"
1339 "{\n"
1340 " char path[PATH_MAX];\n"
1341 " char **args = arg;\n"
1342 " char *new_root = args[0];\n"
1343 " const char *put_old = \"/oldrootfs\";\n"
1344 "\\&\n"
1345 " /* S'assurer que \\[aq]new_root\\[aq] et son point de montage parent\n"
1346 " n’aient pas une propagation partagée (ce qui ferait renvoyer une\n"
1347 " erreur à pivot_root()) et empêcher la propagation des événements\n"
1348 " de montage dans l'espace de noms de montage initial. */\n"
1349 "\\&\n"
1350 " if (mount(NULL, \"/\", NULL, MS_REC | MS_PRIVATE, NULL) == -1)\n"
1351 " err(EXIT_FAILURE, \"mount-MS_PRIVATE\");\n"
1352 "\\&\n"
1353 " /* S'assurer que \\[aq]new_root\\[aq] soit un point de montage. */\n"
1354 "\\&\n"
1355 " if (mount(new_root, new_root, NULL, MS_BIND, NULL) == -1)\n"
1356 " err(EXIT_FAILURE, \"mount-MS_BIND\");\n"
1357 "\\&\n"
1358 " /* Créer le répertoire où l'ancienne racine sera envoyée. */\n"
1359 "\\&\n"
1360 " snprintf(path, sizeof(path), \"%s/%s\", new_root, put_old);\n"
1361 " if (mkdir(path, 0777) == -1)\n"
1362 " err(EXIT_FAILURE, \"mkdir\");\n"
1363 "\\&\n"
1364 " /* Et changer de système de fichiers racine. */\n"
1365 "\\&\n"
1366 " if (pivot_root(new_root, path) == -1)\n"
1367 " err(EXIT_FAILURE, \"pivot_root\");\n"
1368 "\\&\n"
1369 " /* Déplacer le répertoire de travail dans \"/\". */\n"
1370 "\\&\n"
1371 " if (chdir(\"/\") == -1)\n"
1372 " err(EXIT_FAILURE, \"chdir\");\n"
1373 "\\&\n"
1374 " /* Démonter l'ancienne racine et supprimer le point de montage. */\n"
1375 "\\&\n"
1376 " if (umount2(put_old, MNT_DETACH) == -1)\n"
1377 " perror(\"umount2\");\n"
1378 " if (rmdir(put_old) == -1)\n"
1379 " perror(\"rmdir\");\n"
1380 "\\&\n"
1381 " /* Exécuter la commande indiquée dans argv[1]... */\n"
1382 "\\&\n"
1383 " execv(args[1], &args[1]);\n"
1384 " err(EXIT_FAILURE, \"execv\");\n"
1385 "}\n"
1386 "\\&\n"
1387 "int\n"
1388 "main(int argc, char *argv[])\n"
1389 "{\n"
1390 " char *stack;\n"
1391 "\\&\n"
1392 " /* Créer un processus enfant dans un nouvel espace de noms de montage. */\n"
1393 "\\&\n"
1394 " stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE,\n"
1395 " MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);\n"
1396 " if (stack == MAP_FAILED)\n"
1397 " err(EXIT_FAILURE, \"mmap\");\n"
1398 "\\&\n"
1399 " if (clone(child, stack + STACK_SIZE,\n"
1400 " CLONE_NEWNS | SIGCHLD, &argv[1]) == -1)\n"
1401 " err(EXIT_FAILURE, \"clone\");\n"
1402 "\\&\n"
1403 " /* Le parent arrive ici ; attendre l'enfant. */\n"
1404 "\\&\n"
1405 " if (wait(NULL) == -1)\n"
1406 " err(EXIT_FAILURE, \"wait\");\n"
1407 "\\&\n"
1408 " exit(EXIT_SUCCESS);\n"
1409 "}\n"
1410
1411 #. type: TH
1412 #: fedora-44 fedora-rawhide
1413 #, no-wrap
1414 msgid "2024-07-23"
1415 msgstr "23 juillet 2024"
1416
1417 #. type: TH
1418 #: fedora-44 fedora-rawhide
1419 #, no-wrap
1420 msgid "Linux man-pages 6.13"
1421 msgstr "Pages du manuel de Linux 6.13"
1422
1423 #. type: TH
1424 #: mageia-cauldron
1425 #, no-wrap
1426 msgid "Linux man-pages 6.17"
1427 msgstr "Pages du manuel de Linux 6.17"
1428
1429 #. type: TH
1430 #: opensuse-leap-16-1 opensuse-tumbleweed
1431 #, no-wrap
1432 msgid "Linux man-pages (unreleased)"
1433 msgstr "Pages du manuel de Linux (non publiées)"