Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Sep 1997 21:45:00 -0600 (MDT)
From:      Marc Slemko <marcs@znep.com>
To:        "Jamil J. Weatherbee" <jamil@counterintelligence.ml.org>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Select syscall
Message-ID:  <Pine.BSF.3.95.970901214128.6657D-100000@alive.znep.com>
In-Reply-To: <Pine.BSF.3.96.970901200346.3652A-100000@counterintelligence.ml.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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?
> 
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.970901214128.6657D-100000>