Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Mar 95 9:32:28 MST
From: (Terry Lambert)
To: (TR Nguyen)
Subject:   Re: Asynch I/O: poll(2)/select(2)
Message-ID:  <>
In-Reply-To: <> from "TR Nguyen" at Mar 16, 95 00:05:32 am

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
> On SystemV unices, the system call poll(2) is used for multiple file
> descriptor polling, and select(2) is implemented on top of poll(2).
> I'm used to the Alpha runing OSF/1 (POSIX compliant). For many reasons
> I've always preferred poll(2) over select(2)
> When porting my code to FreeBSD, I wrote my own version of poll
> by translating poll(2)'s argument to select()'s format.
> call select(2) to poll my file descriptors,
> then translate select(2)'s result back to the format used by poll(2).
> This works fine, but I'm wondering if someone did this before.
> I would appreciate some examples (other than my own), preferably
> a kernel-level implementation, rather than at the Programmer Interface
> Level (API). I'm very interested in the most efficient implementation
> possible.
> I am aware that FreeBSD is striving to become POSIX compliant.
> (1003.1? 1003.4?) 

The problem with poll is that it has a 10ms resoloution limit, which
is actually in violation of the SVID III (RT) requirements for select
if you build select on top of poll.

Going the other direction is acceptable, but the timeout update in
select doesn't work anywhere I know of, besides Linux.  Even then,
Linux has timer limitations that are inconvenient.

I'm sure that your poll-on-top-of-select would find use, probably
as part of libcompat, although people expecting timeout updating are
going to be suprised.

					Terry Lambert
Any opinions in this posting are my own and not those of my present
or previous employers.

Want to link to this message? Use this URL: <>