Select call for a device driver problem

Edgardo Hames - 98130730 (ehames@hal.famaf.unc.edu.ar)
Fri, 23 Feb 2001 08:51:55 -0300 (ART)


Hello people out there,
We are writing a driver for a device which can be read and written. When a
process tries to read from it and there is nothing in its buffer, we tell
it
to sleep until another process writes to the device. When writing, if the
buffer is full, we tell it to sleep until something is read from the
device.
This is done in the read and write operations for the device, and they
work
well. However, when we do a select on a file descriptor of the device, we
go
right through it and the process is never blocked. What am I doing wrong?
Am
I supposed to check whether the device is opened O_RDONLY, O_WRONLY,
O_RDWR?
If so, where do I do that?
Please include this address in any answer since I'm not
subscribed to the list.
Edgardo Hames
ehames@hal.famaf.unc.edu.ar
Julio Bianco
jbianco@hal.famaf.unc.edu.ar

-- 
Edgardo Hames

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/