Subject: Re: file-locking with fcntl() "broken"?
To: Peter Simons <simons@rhein.de>
From: Chris G. Demetriou <cgd@pa.dec.com>
List: port-i386
Date: 10/27/1997 14:21:53
> while writing some file locking code with fcntl() on NetBSD/i386 1.2,
> I was astonished to realize that fcntl does not set errno to EACCES if
> the file is locked already, as documented in the man page, but sets it
> to EAGAIN.
> 
> While I think both return codes in errno are sane, fcntl() should
> certainly set these things the way it is documented. :-)

FWIW, POSIX doesn't care.  it says that either EAGAIN or EACCES are OK
for that condition.

Either the docs or the code should be fixed.  You should probably
send a PR.


cgd