notification of availability?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I was wondering if there was a way to notify userspace readers about
_how much_ data was to be read, not just readiness for a read or
write? poll(2)/select(2) just let the userspace processes know about
whether or not an operation will block, it would seem.

The problem at hand is that the data being buffered in my driver is of
different sizes (therefore its a character driver, not a block
driver), but the units are stored in a list where a read request will
return 1 or more of the units atomically (meaning that the whole unit
is read or not). For example, if there are 5 units in the list of
sizes 1000, 2000, 4000, 2000 and 6000 bytes, the process should be
notified that there are 15,000 bytes of data available to be read.
Should the process specify a count of 8192 bytes, for example, the
driver could then only write the first three units of memory.

Does anyone know of a way to let the userspace processes know how much
data is in my driver's buffer in advance of a read(2) so that it can
avoid blocking and also exhibit the maximum transfer rate from kernel
to userspace? Thanks in advance! :)

-- 
[ Tobias DiPasquale ]
0x636f6465736c696e67657240676d61696c2e636f6d
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux