From owner-freebsd-hackers Wed May 22 10:01:32 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id KAA10344 for hackers-outgoing; Wed, 22 May 1996 10:01:32 -0700 (PDT) Received: from rover.village.org (rover.village.org [204.144.255.49]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id KAA10337 for ; Wed, 22 May 1996 10:01:25 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by rover.village.org (8.7.5/8.6.6) with SMTP id LAA04803; Wed, 22 May 1996 11:01:03 -0600 (MDT) Message-Id: <199605221701.LAA04803@rover.village.org> To: Kees Jan Koster Subject: Re: Forgiving select() call. Cc: freebsd-hackers@FreeBSD.ORG (FreeBSD hackers Mailing list) In-reply-to: Your message of Wed, 22 May 1996 15:02:14 +0200 Date: Wed, 22 May 1996 11:01:03 -0600 From: Warner Losh Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk : I want to modify select(2) to return the `timeout left' as described in the : BUGS section of the manual page. Any reason why I should not? That is *********NOT******* how select works. Too many programs do not do the right thing when this is done. The failure mode is that things seem to work but you have no CPU left for other thigns. Ths is a *VERY*BAD* idea. Linux tried it and now they have bsd compatible select behavior unless you go our of your way to get the behavior you propose. Why? Too many programs were eating the CPU for lunch because they were poorly programmed. And there were too many to easily fix all of them. Linux is the *ONLY* system that changes the timeval in the select call. It is a bad idea. If it had been a good idea, then Lite or Lite2 would have had it changed. The bug in the man page is really a bug with the man page by now, imho. If you want to have a system call that returns this information, don't call it select. All that said, people should write code that doesn't assume that timeval will be const in this call. Warner