Re: RFC: locking policy for Debian
Christian Schwarz <schwarz@monet.m.isar.de> writes:
> AFAIK, the only way to lock a file (even reliable over NFS) is to create
> another file with a unique filename, e.g. foo.lock-ipaddress-processid,
> and create a link say to foo.lock. The "link" function is atomic per
> definition, even via NFS and will fail if the file already exists. Is this
> correct?
Almost. link(2) is atomic, but it can fail and still return a
succesful return code. It's necessary to check the file with stat(2)
afterwards.
Guy
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: