NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/44950: fcntl(F_MAXFD) returns bogus values
The following reply was made to PR kern/44950; it has been noted by GNATS.
From: Jukka Ruohonen <jruohonen%iki.fi@localhost>
To: Martin Husemann <martin%duskware.de@localhost>
Cc: gnats-bugs%NetBSD.org@localhost, Julio Merino <jmmv%julipedia.org@localhost>
Subject: Re: kern/44950: fcntl(F_MAXFD) returns bogus values
Date: Wed, 11 May 2011 11:05:20 +0300
On Wed, May 11, 2011 at 09:58:18AM +0200, Martin Husemann wrote:
> On Wed, May 11, 2011 at 10:55:08AM +0300, Jukka Ruohonen wrote:
> > for (i = 0; i < 1024; i++)
> > (void)close(i);
> >
> > _exit(fcntl(0, F_MAXFD));
>
> You have done close(0) and now can't fcntl(0, ...). We could make an
> exception
> for F_MAXFD in the kernel (but check the standard carefully first).
Of course, WEXITSTATUS(-1) == 255. As far as I know, F_MAXFD is NetBSD
specific and there has never been a consistent/standard way to obtain the
number of open descriptors.
- Jukka.
Home |
Main Index |
Thread Index |
Old Index