Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.sources.games Subject: Re: problems with galaxy/robots/others on Sys V Rel 2 Message-ID: <2319@sun.uucp> Date: Tue, 18-Jun-85 04:11:35 EDT Article-I.D.: sun.2319 Posted: Tue Jun 18 04:11:35 1985 Date-Received: Thu, 20-Jun-85 07:46:55 EDT References: <739@burl.UUCP> <338@cuae2.UUCP> Organization: Sun Microsystems, Inc. Lines: 20 > > The problems mentioned compiling galaxy, robots, and others are > > due to the use of the flock() utility of BSD, which Sys V does > > not have. flock() is a general-purpose advisory lock routine... > UNIX System V Rel. 2 does support file locking through the fcntl system > call. UNIX S5R2V2 (for the VAX, anyway) supports file locking, but S5R2V1 doesn't. This caused a problem when a "System V compatible" version of one of the aforementioned games didn't build on a System V system. Until such time as every UNIX system out there supports file locking, you might want to consider the "old reliable" link mechanism. Each file to be locked has a file associated with it (which can be the file itself). To lock the file, make a link to the associated file (which has a well-known name) with another well-known name. If the link already exists (i.e., the file is locked), the link will fail. "unlink" unlocks the file. Crude, but effective, and it works on every UNIX out there. Guy Harris