From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_05,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!orion.oac.uci.edu!ucivax!gateway From: jduarte@liege.ICS.UCI.EDU (J o s e D u a r t e) Newsgroups: comp.lang.ada Subject: Re: special Ada functions Message-ID: <9106191407.aa02750@PARIS.ICS.UCI.EDU> Date: 19 Jun 91 21:08:11 GMT Reply-To: "Jose A. Duarte" X-Newsgroups: comp.lang.ada X-Original-Path: ucivax!orion.oac.uci.edu!usc!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!news.cs.indiana.edu!wrdis01!cfranz X-References: <818@wrdis01.af.mil> In-Reply-To: <818@wrdis01.af.mil> X-Organization: UC Irvine Department of ICS List-Id: > I am looking for an Ada package that includes the following > functions/procedures: > 1. Record locking > 2. A function that takes a signal (character) from the keyboard without > the usage of the return key. For example: I use only the up arrow key > to move up the screen. > > Also I would be interested if these functions could be written in Ada only > (no assembly). > > I use an ATT 3B2 with the Verdix 5.7C Ada compiler under Unix. For "1." above you can use the C library functions flock(),lockf(), or fcntl() by making "pragma" interfaces to 'em...Locks set by lockf() aren't compatible with locks set by flock(); however, they are compatible with locks set by fcntl(). > Take a look at the man page for lockf(3c), that will tell you how to > set and test the locks. The locks will go across NFS just fine. > > The biggest thing to remember is that these locks are advisory (lockf), > meaning that only processes that test for the lock on the file will be aware > of the lock (so multiple copies of programs you write that use the lock > won't collide), but other programs can still write to the file without > even looking at the lock. > If you want to turn the locks into mandatory locks that will prevent > other processes from writing to the file, you need to set the file's > mode bits to a special value. This should be explained in the man > page. I'm pretty sure that "2." was previously discussed, but I didn't save the solutions proposed by people. Jose' D.