This might not exactly be what you want, but struct kevent has a member called 
"data" which, for sockets and pipes, returns the number of available bytes to 
read (or write) for EVFILT_READ (or EVFILT_READ) events. 

-- 
Good, fast and cheap: pick any two.


On Saturday, April 7, 2012 at 10:16 PM, Ivan Voras wrote:

> Hi,
> 
> I'm tracking down an obscure bug in my userland program and it might
> have something to do with the way I write&read data through a (Unix
> domain) socket. I'm setting SO_SNDBUF and SO_RCVBUF, and what I'm
> looking for is some way to query the amount of TX & RX buffered / free
> data on a socket. Is there something I can use? I'll even accept
> inspecting kernel structures if explained in detail and can be done on
> a running system.
> 
> Alternatively, is there anything else which could cause poll(2) with
> POLLOUT on a socket to return no events ready on such a socket? (my
> expectation being that a socket is always ready to be written to if
> there is buffer space free...).
> _______________________________________________
> freebsd-hackers@freebsd.org (mailto:freebsd-hackers@freebsd.org) mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org 
> (mailto:freebsd-hackers-unsubscr...@freebsd.org)"



_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to