Consider this (not so hypothetical case): we have a linux device driver implementing a device file. This device file has a cyclic ring buffer, and data gets written into it (by the kernel) occasionally. We want to allow user space processes to mmap(2) the ring buffer, in order to read the data conveniently and efficiently. My question: how does the kernel "notify" the user space process that there's new data to be read, 'n' bytes, starting from offset 'foo' in the buffer? Is there a standard way to do it? The little research I've just done indicates that there's no standard way. The drivers I've looked at use a combination of poll/select and ioctl (yuck) to implement it. Does anyone know of a standard (or at least well accepted) way to accomplish this feat? I don't mind implementing my own protocol (I'm writing both the device file, which is syscalltrack's log device file, and the client application, which is a logging daemon sitting atop it) but I'd rather use a standard solution, if one exists. Also, I already have read implemented - I'd like to use mmap to avoid the copy to user space and to experiment. Thanks in advance... -- http://vipe.technion.ac.il/~mulix/ http://syscalltrack.sf.net/
Attachment:
pgp00131.pgp
Description: PGP signature