Document the behavior of dup2 when oldfd == newfd: nothing happens.

Suggested by the patches in PR bin/36551 from Greg A. Woods.
This commit is contained in:
dholland 2008-02-09 04:58:30 +00:00
parent 2069154485
commit 3ad5f9069e
1 changed files with 7 additions and 2 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: dup.2,v 1.18 2004/05/13 10:20:58 wiz Exp $
.\" $NetBSD: dup.2,v 1.19 2008/02/09 04:58:30 dholland Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -29,7 +29,7 @@
.\"
.\" @(#)dup.2 8.1 (Berkeley) 6/4/93
.\"
.Dd June 4, 1993
.Dd February 8, 2008
.Dt DUP 2
.Os
.Sh NAME
@ -95,6 +95,11 @@ If this descriptor is already
in use, the descriptor is first deallocated as if a
.Xr close 2
call had been done first.
If
.Fa newd
and
.Fa oldd
are the same, the call has no effect.
.Sh RETURN VALUES
The value \-1 is returned if an error occurs in either call.
The external variable