Here’s what I did:
fs-cifs //smbserver:10.0.0.200:/shared /server username password
I can now see the cifs directory mounted on /server.
If I lose the network connection (i.e. I unplug the ethernet cable),
doing open() on any file on /server would block the call until I plug
the cable back in.
What I’d like to do is to set up a timeout on the open call,
I first thought that I could do this by simply wrapping the open() in my
int open_nb(const char* path)
uint64_t nsec = 5000000000LL; // 5 secs timeout
TimerTimeout(CLOCK_REALTIME, _NTO_TIMEOUT_SEND | _NTO_TIMEOUT_REPLY,
&event, &ntime, NULL);
return open(path, O_RDONLY);
The call I made was:
int fd = open_nb("/server/testfile");
This call still resulted in my program being REPLY-blocked indefinetely
Any idea anyone??