]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
dup.2: Further clarify the effect of dup2()
authorMichael Kerrisk <mtk.manpages@gmail.com>
Tue, 23 Mar 2021 10:33:40 +0000 (11:33 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Tue, 23 Mar 2021 10:33:40 +0000 (11:33 +0100)
Add a sentence explaining what dup2() does in terms of file
descriptors and open file descriptions.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/dup.2

index b7fa3c4215330d4ca9fc84d4e30d6765f4b3f248..f90c7561bfb8dfc7abd055e28fa0374e0721bde4 100644 (file)
@@ -86,6 +86,12 @@ system call performs the same task as
 but instead of using the lowest-numbered unused file descriptor,
 it uses the file descriptor number specified in
 .IR newfd .
+In other words,
+the file descriptor
+.I newfd
+is adjusted so that it now refers to the same open file description as
+.IR oldfd .
+.PP
 If the file descriptor
 .IR newfd
 was previously open, it is closed before being reused;