From owner-freebsd-questions Thu Mar 16 08:38:53 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id IAA12524 for questions-outgoing; Thu, 16 Mar 1995 08:38:53 -0800 Received: from cs.weber.edu (cs.weber.edu [137.190.16.16]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id IAA12517 for ; Thu, 16 Mar 1995 08:38:49 -0800 Received: by cs.weber.edu (4.1/SMI-4.1.1) id AA23382; Thu, 16 Mar 95 09:32:29 MST From: terry@cs.weber.edu (Terry Lambert) Message-Id: <9503161632.AA23382@cs.weber.edu> Subject: Re: Asynch I/O: poll(2)/select(2) To: nguyen@omega.uta.edu (TR Nguyen) Date: Thu, 16 Mar 95 9:32:28 MST Cc: freebsd-questions@FreeBSD.org In-Reply-To: <199503160605.AAA00657@omega.uta.edu> from "TR Nguyen" at Mar 16, 95 00:05:32 am X-Mailer: ELM [version 2.4dev PL52] Sender: questions-owner@FreeBSD.org Precedence: bulk > 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 terry@cs.weber.edu --- Any opinions in this posting are my own and not those of my present or previous employers.