]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
pivot_root.2: Eliminate text suggesting that behavior may change in the future
authorMichael Kerrisk <mtk.manpages@gmail.com>
Tue, 10 Sep 2019 09:35:37 +0000 (11:35 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 23 Sep 2019 11:11:19 +0000 (13:11 +0200)
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>
man2/pivot_root.2

index 68ffb8e037fdaa3fe31ff2217c56ba16d255a3a2..a2099144aadd924d4a102b1462dfeed899fc71b3 100644 (file)
@@ -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