Skip site navigation (1)Skip section navigation (2)
Date:      16 Jul 1999 00:34:59 -0700
From:      Arun Sharma <adsharma@home.com>
To:        Vasudha Ramnath <vasu@krdl.org.sg>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: implementing poll() in a device driver (fwd)
Message-ID:  <m3so6p3v4s.fsf@c62443-a.frmt1.sfba.home.com>
In-Reply-To: Vasudha Ramnath's message of "Fri, 16 Jul 1999 13:07:40 %2B0800 (SGT)"
References:  <Pine.GSO.4.02.9907161305580.7242-100000@boderek>

next in thread | previous in thread | raw e-mail | index | archive | help
Vasudha Ramnath <vasu@krdl.org.sg> writes:

> 
> I'm running FreeBSD 3.1-RELEASE.
> 
> Could someone explain what the poll() function in a device driver should
> do ?
> 
> Can it return POLLERR or POLLHUP ?
> 
> I have a test driver that returns these values from the poll() function.
> However, the application
> that called the select() is not getting an error. Instead, the select
> is returning that the particular file descriptor is, in this case, 
> 'readable' !

Take a look at "selscan" algorithm in /usr/src/sys/kern/sys_generic.c
if you wish to learn more.

Basically, if your driver doesn't implement the poll() functionality,
it can always return 0. This will ensure that select never wakes up
because of a file descriptor associated with your driver.

	-Arun


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m3so6p3v4s.fsf>