mirror of https://github.com/mkerrisk/man-pages
pivot_root.2: Eliminate text suggesting that behavior may change in the future
After around 19 years, the behavior of pivot_root() has not been changed, and will almost certainly not change in the future. So, reword to remove the suggestion that the behavior may change. Also, more clearly document the effect of pivot_root() on the calling process's current working directory. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
4a8b7d7b13
commit
682e1329f9
|
@ -33,7 +33,7 @@ the same mount namespace as the caller of
|
|||
.BR pivot_root ().
|
||||
The caller of
|
||||
.BR pivot_root ()
|
||||
must ensure that processes with root or current working directory
|
||||
should ensure that processes with root or current working directory
|
||||
at the old root operate correctly in either case.
|
||||
An easy way to ensure this is to change their
|
||||
root and current working directory to \fInew_root\fP before invoking
|
||||
|
@ -45,20 +45,25 @@ It is therefore recommended to call
|
|||
\fBchdir("/")\fP immediately after
|
||||
.BR pivot_root ().
|
||||
.PP
|
||||
The paragraph above is intentionally vague because the implementation of
|
||||
.BR pivot_root ()
|
||||
may change in the future
|
||||
(or so it was thought when this system call was first added).
|
||||
However,
|
||||
the behavior on this point has remained consistent since
|
||||
The paragraph above is intentionally vague because at the time when
|
||||
.BR pivot_root ()
|
||||
was first implemented, it was unclear whether its affect
|
||||
on other process's root and current working directories\(emand
|
||||
the caller's current working directory\(emmight change in the future.
|
||||
However, the behavior has remained consistent since this system call
|
||||
was first implemented:
|
||||
.BR pivot_root ()
|
||||
changes the root directory and the current working directory
|
||||
of each process or thread in the same mount namespace to
|
||||
.I new_root
|
||||
if they point to the old root directory.
|
||||
See also NOTES.
|
||||
(See also NOTES.)
|
||||
On the other hand,
|
||||
.BR pivot_root ()
|
||||
does not change the caller's current working directory
|
||||
(unless it is on the old root directory),
|
||||
and thus it should be followed by a
|
||||
\fBchdir("/")\fP call.
|
||||
.PP
|
||||
The following restrictions apply:
|
||||
.IP \- 3
|
||||
|
|
Loading…
Reference in New Issue