title: Socket reading and timestamps
body: <p>When reading from a (non-stream) socket in Linux, I can get the (hardware-generated) timestamp of the last received message via a <code>ioctl(sock, SIOCGSTAMP, &amp;tv)</code>. However, this poses two problems:</p>
  
  <ul>
  <li>It is another syscall (I'm receiving about 24000 messages per second, so each syscall is notifiable)</li>
  <li>If using this approach, I can only <code>read()</code> one message at a time, followed by the <code>ioctl()</code> to get the timestamp. (If I'm reading more than one message in a <code>read()</code>-call, the following <code>ioctl</code> only yields the timestamp of the last message.)</li>
  </ul>
  
  <p>My question is how to achieve receiving messages and their timestamps in as few syscalls as possible. It would be perfect if there was a syscall with semantics like "read as much messages as are pending and their timestamps".</p>