From owner-freebsd-hackers Wed Mar 12 20:58:46 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1880637B401 for ; Wed, 12 Mar 2003 20:58:45 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 56A4443F85 for ; Wed, 12 Mar 2003 20:58:44 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.7/8.12.7) id h2D4wgst075271; Wed, 12 Mar 2003 22:58:42 -0600 (CST) (envelope-from dan) Date: Wed, 12 Mar 2003 22:58:42 -0600 From: Dan Nelson To: Sean Hamilton Cc: hackers@FreeBSD.ORG Subject: Re: first parameter to select Message-ID: <20030313045842.GG2336@dan.emsphone.com> References: <000501c2e911$96ea79a0$d1d7e8d8@slugabed.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000501c2e911$96ea79a0$d1d7e8d8@slugabed.org> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.3i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Mar 12), Sean Hamilton said: > What is the first parameter to select(2) for? Microsoft's select > ignores it, and it does not appear to have any valid use since it > only allows constraints on values which are assigned by the system. I'd hate to have the kernel scan a 6000-element (or whatever maxfiles is on your system) array every time I called select with nfds=10. If MS ignores the nfds parameter, it risks accessing uninitialized memory or selecting on fds that the user no longer wants to look at. I'd call it a bug. > Purely historic? Performance. -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message