Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!stl!robobar!ronald From: ronald@robobar.co.uk (Ronald S H Khoo) Newsgroups: comp.os.minix Subject: Re: File locking in MINIX and UNIX Message-ID: <1991Feb17.112913.4873@robobar.co.uk> Date: 17 Feb 91 11:29:13 GMT References: <39313@cup.portal.com> <1991Feb16.013731.18087@jarvis.csri.toronto.edu> Organization: Robobar Ltd., Perivale, Middx., ENGLAND. Lines: 24 wayne@csri.toronto.edu (Wayne Hayes) writes: > Well, some Unixes support *voluntary* file locking, that is, the OS will > tell you if a file is locked only if you ask, but it's not enforced. Xenix and reasonably current releases of System V DO support mandatory (ie it *is* enforced if you ask for it to be) file locking. Perhaps you are thinking of BSD ? > Also, the first process has to explicitly lock the file, and the second > process has to explicitly ask if the file is locked. Not if mandatory file locking has been requested. The exact behaviour depends on the implementation, but typically reads/write requests will block until the lock has been released, and creat() may fail with EAGAIN. > [ advisory locking can be ] > construed as a feature, and is *very* useful under many circumstances. This is, of course true. But as you note, mailboxes should be locked with mandatory locking where available. -- Ronald Khoo +44 81 991 1142 (O) +44 71 229 7741 (H)