From owner-freebsd-hackers Mon Sep 1 20:44:19 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id UAA11138 for hackers-outgoing; Mon, 1 Sep 1997 20:44:19 -0700 (PDT) Received: from scanner.worldgate.com (scanner.worldgate.com [198.161.84.3]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id UAA11133 for ; Mon, 1 Sep 1997 20:44:14 -0700 (PDT) Received: from znep.com (uucp@localhost) by scanner.worldgate.com (8.8.7/8.8.7) with UUCP id VAA29469; Mon, 1 Sep 1997 21:44:06 -0600 (MDT) Received: from localhost (marcs@localhost) by alive.znep.com (8.7.5/8.7.3) with SMTP id VAA07909; Mon, 1 Sep 1997 21:45:01 -0600 (MDT) Date: Mon, 1 Sep 1997 21:45:00 -0600 (MDT) From: Marc Slemko To: "Jamil J. Weatherbee" cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Select syscall In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk select() is under no obligation to modify the time passed in, but it has been documented for a very long time in the BSD man pages that it may. You should reset the time. Do not assume it is unchanged. There are few applications where the overhead of the select syscall and whatever else you do with it (not to mention the time that select is waiting anyway) would not be comparitively large enough to make resetting the time value of insignificant consequence from the performance perspective. On Mon, 1 Sep 1997, Jamil J. Weatherbee wrote: > > I was looking at the man page on select and some books, and I was just > wondering what the would be good programming pratice when calling select > in a tight look with a non-zero timeout value. Is select supposed to > change the timeout value (I know that this occurs under linux to reflect > time elapsed), or can you set the timeout value once and call select > multiple times without fooling with it, right now I'd just assume to fill > up timeout immediately before any select call, but since it is being > called in an infinite for loop it would be more efficient to have it on > the outside --- will this work on all BSD systems or do some change it? > >