I'm using NETLINK socket to receive NETLINK_ROUTE notifications in a user-space application.
I understand that ENOBUFS error is returned from recvmsg()
when:
- The user-space application is too slow to handle all the NETLINK messages that the kernel subsystem sends at a give rate.
- The queue that is used to store messages that go from kernel to user-space is too small.
Now, am sure that the second point does not happen in my case since am able to receive certain notifications initially without any error.
After a period of time, I get the ENOBUFS error.
My doubt is that when the recvmsg()
returns ENOBUFS:
- Will it also fill and return the available messages that are still in the socket buffer?
- Or will it just return ENOBUFS?
Because, according to my understanding, if the socket buffer is full and NETLINK cannot write any more notifications onto the socket buffer, then it means there are still messages that need to be read from the socket.