Subject: Re: EISDIR on directory read(2)
To: Giles Lean <firstname.lastname@example.org>
From: Chris G. Demetriou <email@example.com>
Date: 10/10/1999 12:03:27
Giles Lean <firstname.lastname@example.org> 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
if (vp->v_type == VDIR)
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 - email@example.com - http://www.netbsd.org/People/Pages/cgd.html
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.