Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hpfcdc!rml From: rml@hpfcdc.HP.COM (Bob Lenk) Newsgroups: comp.sys.hp Subject: Re: linking BSD type software on HP-UX Message-ID: <5570144@hpfcdc.HP.COM> Date: 4 Apr 89 20:51:06 GMT References: <940@eastman.UUCP> Organization: HP Ft. Collins, Co. Lines: 17 > Here is an flock() emulation. flock() handles shared locks plus > exclusive locks. This only does exclusive locks. The locking > available from fcntl() is equivalent to flock(), so this really should > be rewritten to use fcntl(). BSD flock() cannot be completely emulated by either lockf() or fcntl(). While such emulations are likely to work for many (perhaps even most) applications, the semantics of interactions among related processes or multiple opens of the same file from the same process are quite different. flock() locks a file to an open instance (a kernel file structure, shared across dup() and fork()), while lockf()/fcntl() lock a file to a process. I have no idea how many applications would be affected by the differences, but users need to beware. Bob Lenk hplabs!hpfcla!rml rml%hpfcla@hplabs.hp.com