close() returns bogus errno for xy0* under 4.0.1EXPORT

John Ioannidis ji at cs.columbia.edu
Thu Mar 16 11:30:16 AEST 1989


What's wrong with the following program fragment?

                fd = open("/dev/xy0g", 2);      /* fd gets set to 3 */
                ...
                if (close(fd) < 0)
                  perror("closing");

Nothing, one would say. But on a 3/280, with a Xylogics 451 and a NEC
drive hanging off of it, that close() returns -1 and errno is set to 1
(EPERM, "Not owner"). This doesn't happen if I open the corresponding
character-special file, and it doesn't happen for a SCSI drive (shoeboxes
connected to 3/60s) and it doesn't happen under 3.4.  Furthermore,
examining the kernel structures reveals that the file has been correctly
closed, fd's, file and vnode tables, the works, have been correctly
updated, and just somehow somewhere the carry bit is being set. A quick
(<1 day) inspection of the sources revealed nothing. Has anybody else
experienced this? Is it a known bug?

adTHANKSvance,

/ji

#include <appropriate disclaimers>

In-Real-Life: John Ioannidis
E-Mail-To: <ji at cs.columbia.edu> (preferred), or <ji at walkuere.altair.fr>
P-Mail-To: GIP-Altair, Dom de Voluceau BP105, Rocquencourt 78153 Le Chesnay, FR
V-Mail-To: +33 1 39635227, +33 1 39635417

[[ Someone reported a similar problem in a device driver that he wrote.
See v7n153.  --wnl ]]



More information about the Comp.sys.sun mailing list