mirror of https://github.com/mkerrisk/man-pages
dup.2: Further clarify the effect of dup2()
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>
This commit is contained in:
parent
8b339e35fa
commit
b96ad91c7c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue