tech-kern archive

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

Re: open modes O_DENYREAD and O_DENYWRITE



On Wed, Feb 06, 2013 at 09:52:34AM +0100, Martin Husemann wrote:
> On Wed, Feb 06, 2013 at 08:19:41AM +0000, David Laight wrote:
> > There is a current thread on some of the linux lists and wine-devel
> > about the semantice of two more open modes O_DENYREAD and O_DENYWRITE.
> > 
> > These are being implemented (I think only for nfs and samba at the
> > moment) in order to support the equivalent windows open modes.
> 
> FYI, the windows modes that match our model are SHARE_DENY_NONE (0) and
> SHARE_EXCLUSIVE (O_EXCL), but O_SHLOCK is split into SHARE_DENY_READ and
> SHARE_DENY_WRITE.
> 
> It kind of makes sense to me, but I don't have an easy example where the
> difference would be vital.

IIRC O_EXCL only applies to creates.
Reading the man page O_SHLOCK and O_EXLOCK only acquire flock() type locks.

The windows modes are hard enforced - and are a right PITA at times since
a lot of programs open files exclusively.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index