Ron Kerry <[email protected]> wrote: > Eric - > > I discussed this with one of our DMF engineers. He asked me to pass along the > following message. It > looks like opening with O_NONBLOCK and then using fcntl() to clear the > O_NONBLOCK flag will work in > a DMF context. > > - Ron > > ---------------- > > Okay, I wrote a test program to verify the behavior. The other person > is correct, if you've got a fifo, you need the O_NONBLOCK on the open to > prevent the hang. My test program did an open with O_NONBLOCK, then did > an fstat on the fd, and if a fifo, it closed the file. If not a fifo, > it used fcntl(fd, F_SETFL) to clear the O_NONBLOCK flag before issuing > the read call. This works correctly for DMF, we get the behavior we > want. I think it will also do the right thing for leased files. Thanks > for the help on this!
The main problem in this context is that the behavior for O_NONBLOCK on non-FIFO files is _unspecified_. The solution you are currently discussing is specific to the implementation of your HSM. Other software could have a behavior that would cause other problems in case you use the solution that works for your HSM. Jörg -- EMail:[email protected] (home) Jörg Schilling D-13353 Berlin [email protected] (uni) [email protected] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily
