A problem with the select(2) interface

Dag-Erling Smørgrav des at des.no
Thu May 17 10:44:19 UTC 2007


Peter Jeremy <peterjeremy at optushome.com.au> writes:
> There are two situations where the actual behaviour matters:
> 1) Porting a random application that assumes specific behaviour for
>    select().  I need to know how FreeBSD behaves to know whether I
>    need to patch the code or not.

Easy: patch the code to not assume anything about the contents of the
struct timeval after select(2) returns.

> 2) I'm writing code that is specifically for FreeBSD.  If I know
>    timeout will not change, I can optimise the code to avoid having to
>    re-initialise timeout before each select call.

OK, I'll bite.  If you can show me that you were actually able to
measure the difference in performance between code that reinitializes
the timeout every time and code that doesn't, I'll commit your patch.

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the freebsd-arch mailing list