EXCL without CREAT
Henry Spencer
henry at utzoo.UUCP
Sun Dec 22 12:15:34 AEST 1985
> ] utzoo!henry points out problem of fool opening/locking /etc/passwd
> ] and claims that adding open("arg", O_READ|EXCL) re-invents flock()
>
> Doesn't re-invent flock() -- open()/flock() is not an atomic action.
Who cares if the open() succeeds, so long as the process doesn't do
anything to the file until a successful flock()? The sequence is not
atomic, but that doesn't matter.
--
Henry Spencer @ U of Toronto Zoology
{allegra,ihnp4,linus,decvax}!utzoo!henry
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list