Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!ukma!tut.cis.ohio-state.edu!rutgers!att!mtunb!jcm From: jcm@mtunb.ATT.COM (was-John McMillan) Newsgroups: comp.unix.questions Subject: Re: System V file/record locking? Message-ID: <1386@mtunb.ATT.COM> Date: 3 Feb 89 15:09:16 GMT References: <477@maxim.ERBE.SE> Reply-To: jcm@mtunb.UUCP (was-John McMillan) Organization: AT&T ISL Middletown NJ USA Lines: 30 In article <477@maxim.ERBE.SE> prc@maxim.ERBE.SE (Robert Claeson) writes: ... >1. What's the difference between the lockf(3) function and the locking > calls to the fcntl(2) system call? Since lockf is a function in the > standard library, one would expect it to be implemented using fcntl. LOCKF, indeed, uses FCNTL. It just saves your management of the 'flock' struct, and generalizes the error returns (into EDEADLK). >2. lockf always uses "exclusive" locks. Does this mean that it sets > a write lock on the file segment? It always uses F_WRLCK. >3. What is the "l_whence" field used for in the flock struct (used as > argument to the locking functions of fcntl)? The same thing as in > the lseek system call? Yes. >4. The documentation mentions a "F_CHKFL" function of fcntl in the man > page for fcntl(5). What does this function do and how do I use it? (^; NOMEX ON ;^) I believe it's an abstraction of FSS which is un-utilized in fs/s5. Ie., it's a hook for FUTURE features, future types of alien-file-system <-> UNIX manglings. ...But then, even I don't trust MY beliefs.... jc mcmillan -- att!mtunb!jcm -- Speaking for 'self, not THEM.