Re: [question]

Brandon S. Allbery KF8NH (allbery@kf8nh.apk.net)
Mon, 18 Jan 1999 18:25:04 -0500


In message <Pine.LNX.4.05.9901190015240.26536-100000@schoen3.schoen.nl>,
kees w
rites:
+-----
| Hello Friends,
| I'm puzzled by the returned data of the 'readdir' call. The dirent
| structure has a d_reclen entry. If I run a small C program under 2.0.36
| which returns the d_reclen of the root directory entries I get:
+--->8

d_reclen != d_namelen

d_reclen is the size of the directory entry. This includes the size of the
inode number and potentially any unused space after the entry (from removed
entries). It's there so directory entries can be read efficiently by
skipping the unused entries.

You're probably looking for the d_namelen stuff that BSD directory entries
had but POSIX did not pick up. It's not there. Anyone using d_reclen to
mean the same thing is broken.

-- 
brandon s. allbery	[os/2][linux][solaris][japh]	 allbery@kf8nh.apk.net
system administrator	     [WAY too many hats]	   allbery@ece.cmu.edu
carnegie mellon / electrical and computer engineering			 KF8NH
     We are Linux. Resistance is an indication that you missed the point.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/