Date: Mon, 7 Apr 1997 11:22:44 -0500 (CDT) From: "Kent S. Gordon" <kgor@inetspace.com> To: bde@zeta.org.au Cc: freebsd-ports@freefall.freebsd.org Subject: Re: ports/3205: Mtools-3.0 fails to WRITE to dos partition under 2.2 (fix supplied) Message-ID: <199704071622.LAA15479@chess.inetspace.com> In-Reply-To: <199704060140.RAA13997@freefall.freebsd.org> (message from Bruce Evans on Sat, 5 Apr 1997 17:40:02 -0800 (PST))
next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> "bde" == Bruce Evans <bde@zeta.org.au> writes: > The following reply was made to PR ports/3205; it has been noted > by GNATS. From: Bruce Evans <bde@zeta.org.au> To: > FreeBSD-gnats-submit@FreeBSD.org, > mmcg@heraclitus.cs.monash.edu.au Cc: Subject: Re: ports/3205: > Mtools-3.0 fails to WRITE to dos partition under 2.2 (fix > supplied) Date: Sun, 6 Apr 1997 11:26:48 +1000 Try mtools-3.3. >> On examination, it turns out that rather than using perror(), >> the mtools source uses the following logic: >> >> If flock(device) fails and it's EINVAL Then assume we don't >> need to lock the device otherwise print `device busy' >> >> FreeBSD doesn't return EINVAL for this purpose - it uses >> EOPNOTSUPP. > Perhaps mtools is "right". POSIX.1 specifies EINVAL for > unsupported fcntl() locks, but the FreeBSD file systems return > all lots of different error numbers for it - often EOPNOTSUPP > and sometimes EBADF as well as EINVAL. I fixed fcntl() for a > couple of file systems but tried not to change fclock(). > EOPNOTSUPP is actually documented for flock(), but it is easy to > interpret the docs as saying that EOPNOTSUPP never occurs: > EBADF: fd is an invalid descriptor EINVAL: fd refers to an > object that is not a file EOPNOTSUPP: fd refers to an object > that does not support file locking > I don't know what a file is ;-), but (non-special) files should > support file locking by definition. mtools is trying to lock the device special file. This problem also existed on NetBSD/386. I submitted a patch to the maintainers of mtools a while ago. It looks like mtools-3.3 has solved this by including EOPNOTSUPP as another option in plain_io.c line 80. > Bruce Kent S. Gordon Senior Software Engineer INetSpace Co. voice: (972)851-3494 fax:(972)702-0384 e-mail:kgor@inetspace.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704071622.LAA15479>