ipq_read (3) - Linux Man Pages
ipq_read: read queue messages from ip_queue and read into supplied buffer
ipq_read --- read queue messages from ip_queue and read into supplied buffer
DESCRIPTIONThe ipq_read function reads a queue message from the kernel and copies it to the memory pointed to by buf to a maximum length of len.
The h parameter is a context handle which must previously have been returned successfully from a call to ipq_create_handle.
The caller is responsible for ensuring that the memory pointed to by buf is large enough to contain len bytes.
The timeout parameter may be used to set a timeout for the operation, specified in microseconds. This is implemented internally by the library via the select system call. A value of zero provides normal, backwards-compatible blocking behaviour with no timeout. A negative value causes the function to return immediately.
RETURN VALUEOn failure, -1 is returned.
On success, a non-zero positive value is returned when no timeout value is specified.
On success with a timeout value specified, zero is returned if no data was available to read, or if a non-blocked signal was caught. In the latter case, the global errno value will be set to EINTR.