diff options
| author | Stephen McKay <mckay@FreeBSD.org> | 1997-03-09 13:16:48 +0000 |
|---|---|---|
| committer | Stephen McKay <mckay@FreeBSD.org> | 1997-03-09 13:16:48 +0000 |
| commit | ac225cf76dfd6293ef024bdd2a3a7a24787bacb3 (patch) | |
| tree | cc6d81e8c61878a8eb3f7cd8a0c73735b61008e1 /lib | |
| parent | eac4b079c7da09e762efd941e6513aeb711c9545 (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libc/sys/dup.2 | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/lib/libc/sys/dup.2 b/lib/libc/sys/dup.2 index 66c9d29728c54..58a967d22e015 100644 --- a/lib/libc/sys/dup.2 +++ b/lib/libc/sys/dup.2 @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)dup.2 8.1 (Berkeley) 6/4/93 -.\" $Id$ +.\" $Id: dup.2,v 1.7 1997/02/22 15:03:49 peter Exp $ .\" .Dd June 4, 1993 .Dt DUP 2 @@ -92,10 +92,27 @@ In .Fn dup2 , the value of the new descriptor .Fa newd -is specified. If this descriptor is already -in use, the descriptor is first deallocated as if a +is specified. If this descriptor is already in use and +.Fa oldd +!= +.Fa newd , +the descriptor is first deallocated as if a .Xr close 2 -call had been done first. +call had been used. +If +.Fa oldd +is not a valid descriptor, then +.Fa newd +is not closed. +If +.Fa oldd +== +.Fa newd +and +.Fa oldd +is a valid descriptor, then +.Fn dup2 +is successful, and does nothing. .Sh IMPLEMENTATION NOTES .Pp In the non-threaded library |
