Subject: Re: getdent, d_type and NFS
To: Emmanuel Dreyfus <manu@netbsd.org>
From: Frank van der Linden <fvdl@netbsd.org>
List: tech-kern
Date: 10/30/2003 13:13:34
On Wed, Oct 29, 2003 at 05:26:28PM +0000, Emmanuel Dreyfus wrote:
> It seems getdents will not fill d_type for objects that live on a NFS mount.
> Do I miss something, or should it be documented in getdents(2) and readdir(3)?

It can't always support d_type on NFS (only in the case of NFSv3 using
READDIRPLUS operations is it easy to do; it would have considerable
overhead otherwise).

I'm not entirely sure why we have d_type or how it got into our interface..
I originally didn't document d_type in getdents(2), because it couldn't
be completely supported. And other systems, like Solaris, do not have the
field at all.

So, something must be done, like entirely undocumenting d_type, or remarking
that not all filesystems may support d_type.

- Frank

-- 
Frank van der Linden                                            fvdl@netbsd.org
===============================================================================
NetBSD. Free, Unix-like OS. > 45 different platforms.    http://www.netbsd.org/