Subject: Re: EISDIR on directory read(2)
To: Giles Lean <>
From: Chris G. Demetriou <>
List: tech-kern
Date: 10/10/1999 12:03:27
Giles Lean <> writes:
> For read(2) not to work on directories would require that it do the
> equivalent of fstat(2) on the file descriptor on each call.  Not a
> good idea for performance. :-)

uh, not at all.

the only thing that'd have to change is that vn_read() (in
vfs_vnops.c) would have to check the type of the vnode being read
from.  i.e.:

	if (vp->v_type == VDIR)
		return (EISDIR);

or something very similar, or it should be changed in the underlying
file system routines.

now, whether even that penalty is worthwhile is another question.

Chris Demetriou - -
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.