Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site l5.uucp Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!decwrl!sun!l5!gnu From: gnu@l5.uucp (John Gilmore) Newsgroups: net.bugs.4bsd Subject: Re: file locking misconception Message-ID: <363@l5.uucp> Date: Fri, 27-Dec-85 02:41:22 EST Article-I.D.: l5.363 Posted: Fri Dec 27 02:41:22 1985 Date-Received: Sat, 28-Dec-85 01:41:42 EST References: <5507@allegra.UUCP>, <6220@utzoo.UUCP> <7022@ki4pv.UUCP> Organization: Nebula Consultants in San Francisco Lines: 9 In article <7022@ki4pv.UUCP>, tanner@ki4pv.UUCP (Tanner Andrews) writes: > there's no real > excuse for a read-only prog to need to lock a file if the write-file > prog successfully locks the damned thing anyway. Uh, suppose the readers want a consistent copy of the file? flock(), at least in 4.2BSD, is an *advisory* lock -- it doesn't stop anybody from doing anything with the file except flock() it again. Readers can use shared locks and writers use exclusive locks, for many applications.