NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/45148: dup2(3) and dup3(3) should support EINVAL



The following reply was made to PR lib/45148; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: lib-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
        netbsd-bugs%netbsd.org@localhost
Subject: Re: lib/45148: dup2(3) and dup3(3) should support EINVAL
Date: Fri, 15 Jul 2011 10:40:09 +0200

 On Fri, Jul 15, 2011 at 08:30:00AM +0000, Jukka Ruohonen wrote:
 > In Linux the dup3(3) call fails with EINVAL (a) if the specified flags
 > contain an invalid value or (b) if "newfd" equals "oldfd". The case (b)
 > applies also to dup2(3).
 
 I don't think so:
 
 the open group base spec issue 7 says:
 
   If fildes2 is already a valid open file descriptor, it shall be closed
   first, unless fildes is equal to fildes2 in which case dup2() shall
   return fildes2 without closing it.
 
 Our dup2(3) man page has weaker words, but to the same effect.
 
 Martin
 


Home | Main Index | Thread Index | Old Index