Wanted: lockf system call source

Doug Gwyn gwyn at brl-smoke.ARPA
Sat Nov 29 02:35:10 AEST 1986


In article <2200003 at hpisoa1.HP.COM> davel at hpisoa1.HP.COM (Dave Lennert) writes:
>One interesting thing I noticed about implementing lockf() on top of SysV
>fcntl() file locking is that (it appears) fcntl() requires that the file
>be opened with write permission even for read locking.  Lockf() does not
>require this.
>I'm I correctly stating the situation?  If so, is this regarded as a 
>deficiency in SysV's lockf()?

Dave, our Goulds have System V fcntl() record locking and they require
(only) read permission to set a read lock, write permission to set a
write lock.  I think it's pretty clear that requiring write permission
for a read lock is poor design, whether intentional or not, and should
be fixed in H-P's fcntl() implementation.  Note also that the SVID
(Issue 2) states "The file-descriptor on which a read-lock is being
placed must have been opened with read-access" and "The file-descriptor
on which a write-lock is being placed must have been opened with write-
access", the implication being that such access is also sufficient.



More information about the Comp.unix.wizards mailing list