Re: locking utmp
In article <[🔎] 20020319003413.2730F22BF@lyta.coker.com.au>,
Russell Coker <russell@coker.com.au> wrote:
>fcntl64(4, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
>
>I need to know why it wants to lock a range of length 0. Is this a bug or is
>there some good reason for it?
The standard linux fcntl() manpage doesn't explain it, but google'ing
on "l_len zero" brings up manpages from other Unices which do:
http://www.tac.eu.org/cgi-bin/man-cgi?fcntl+2
"Locks may start and extend beyond the current end of a file, but may not
start or extend before the beginning of the file. A lock is set to ex-
tend to the largest possible value of the file offset for that file if
l_len is set to zero. If l_whence and l_start point to the beginning of
the file, and l_len is zero, the entire file is locked."
Mike.
Reply to: