bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] opening files with O_NONBLOCK causes problems


From: Joerg Schilling
Subject: Re: [Bug-tar] opening files with O_NONBLOCK causes problems
Date: Fri, 06 Jan 2012 15:42:26 +0100
User-agent: nail 11.22 3/20/05

Ron Kerry <address@hidden> 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:address@hidden (home) Jörg Schilling D-13353 Berlin
       address@hidden                (uni)  
       address@hidden (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily



reply via email to

[Prev in Thread] Current Thread [Next in Thread]