Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!udel!mmdf From: wjb%cogsci.COG.JHU.EDU@vm1.nodak.edu Newsgroups: comp.os.minix Subject: Re: File locking in MINIX and UNIX Message-ID: <44837@nigel.ee.udel.edu> Date: 16 Feb 91 18:25:17 GMT Sender: mmdf@ee.udel.edu Lines: 20 >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. >Also, the first process has to explicitly lock the file, and the second >process has to explicitly ask if the file is locked. Regardless of >whether the file is locked, the second (any any other) process(es) may >open the file and do with it as they please. Actually some Unices have *mandatory* locking, but this was not included in POSIX. If people are interested look up fcntl() in the POSIX standard. The rationale they give for not including mandatory locks was the varied methods used on different systems and the difficulty of implementing it on systems that support memory mapped IO... Bill Bogstad P.S. to original starter of this thread (whose address I lost) Everything in my private e-mail to you was correct for some version of UNIX, (just not POSIX). :-) Just think of this as another example of UNIX assumming that the user/programmer knows what they are doing.