Hello, I created a resource manager and an application that uses it. It opens the device alright and then uses select() to wait for any interesting things from the driver. When the driver terminates (due to a crash or a manual command) select doesn’t return - I would expect it to return with errno==EBADF.
Is there a way to achieve this behaviour? I read Xiaodan’s article on http://sendreceivereply.wordpress.com/2008/05/12/daddy-the-network-is-down/
but this means having a dedicated watcher thread setup and then raise a signal against the thread blocked in select() (because, from seeing SIGWAITINFO, I conclude that select() is implemented using signals), or use pthread_cancel() which should work in this state
The other possibility is to use the timeout facility of select() and call it in a loop but really this is not what I want.
Thanks for your advice.