Here is the problem, i have an application that talks to the kernel through a netlink socket. The application receives messages from the kernel throught a dedicated thread that does:
recvmsg(socket, msg, 0);
This works well until I have to stop the application and can't manage to stop the thread since it is still waiting for a message from the kernel. Is there a wake up recvmsg without there being a msg? I don't really want to change to a non-blocking socket if there's a way around this.
All this is in C.