From owner-freebsd-hackers Thu Jul 8 14:38:45 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from sumatra.americantv.com (sumatra.americantv.com [208.139.222.227]) by hub.freebsd.org (Postfix) with ESMTP id 141FD15143 for ; Thu, 8 Jul 1999 14:38:35 -0700 (PDT) (envelope-from jlemon@americantv.com) Received: from right.PCS (right.PCS [148.105.10.31]) by sumatra.americantv.com (8.8.5/8.8.5) with ESMTP id QAA17544; Thu, 8 Jul 1999 16:38:29 -0500 (CDT) Received: (from jlemon@localhost) by right.PCS (8.6.13/8.6.4) id QAA26484; Thu, 8 Jul 1999 16:38:28 -0500 Message-ID: <19990708163828.36990@right.PCS> Date: Thu, 8 Jul 1999 16:38:28 -0500 From: Jonathan Lemon To: Matthew Dillon Cc: jwd@unx.sas.com, hackers@FreeBSD.ORG Subject: Re: Strange select/poll behaviour [EBADF inconsistancy] References: <199907082133.OAA43126@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.61.1 In-Reply-To: <199907082133.OAA43126@apollo.backplane.com>; from Matthew Dillon on Jul 07, 1999 at 02:33:19PM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Jul 07, 1999 at 02:33:19PM -0700, Matthew Dillon wrote: > Not unless you want to blow up virtually every program that uses select!!! > > Passing an nd parameter that is greater then the current number of > descriptors is perfectly valid. It's setting a bit in the bitmask for > one of those descriptors that should return EBADF! Hmm, you're right. Arguably, it could return EINVAL. Actually, the man page documents this behavior, although it gets the 256 number wrong. If nfds is greater than the number of open files, select() is not guaran- teed to examine the unused file descriptors. For historical reasons, select() will always examine the first 256 descriptors. -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message