[OT] fcntl.flock problems on FreeBSD

Eric Jacobs none at none
Fri May 19 06:50:38 CEST 2000


In article <20000517184228.19805.qmail at c391458-a.sttln1.wa.home.com>,
sblakey at freei.com wrote:
> I'm having some trouble with flock in the fcntl module on a FreeBSD 4.0
> box.  Most of the flock operations work perfectly (LOCK_SH, LOCK_EX,
> LOCK_UN), but LOCK_NB seems to alway raise a Bad file descriptor error.
> 
[snip]

(3.3-RELEASE) /sys/kern/kern_descrip.c 1108:

	if (uap->how & LOCK_EX)
		lf.l_type = F_WRLCK;
	else if (uap->how & LOCK_SH)
		lf.l_type = F_RDLCK;
	else
		return (EBADF);


Bad choice of error code. Try LOCK_SH | LOCK_NB or LOCK_EX | LOCK_NB.




More information about the Python-list mailing list