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