Pseudo-device driver & select ??

Aziz Kezzou french.linuxian at gmail.com
Thu May 26 13:39:38 PDT 2005


Hi all,
I am trying to implement a small kld pseudo-device driver on FreeBSD 5.3 that 
behaves just like a socket with regards to the select system call.

Currently, I am using the sample echo pseudo-device driver from
http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/driverbasics-char.html
 as an example. However, whenever  I call select on the file
descriptor of "/dev/echo" it always returns even when there is no data
to be read.

I looked at the socket code and it looks like I need to provide my own
"fo_select" function in the fileops data structure. Am i right ? How
do I do that ? The sample echo pseudo-device driver above uses 
"struct cdevsw"  instead...

Thanks
-aziz


More information about the freebsd-hackers mailing list