title: How do I get amount of queued data for UDP socket?
body: <p>To see how well I'm doing in processing incoming data, I'd like to measure the queue length at my TCP and UDP sockets.</p>
  
  <p>I know that I can get the queue size via <code>SO_RCVBUF</code> socket option, and that <code>ioctl(&lt;sockfd&gt;, SIOCINQ, &amp;&lt;some_int&gt;)</code> tells me the information for TCP sockets. But for UDP the <code>SIOCINQ</code>/<code>FIONREAD</code> ioctl returns only the size of next pending datagram. Is there a way how to get queue size for UDP, without having to parse system tables such as <code>/proc/net/udp</code>?</p>