DragonFly BSD
DragonFly users List (threaded) for 2006-07
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: struct dirent - difference between getdents(2) manpage and definition in /usr/src/sys/dirent.h

From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Wed, 26 Jul 2006 14:40:10 +0200

Joerg Sonnenberger wrote:
On Wed, Jul 26, 2006 at 02:55:00PM +0530, Karthik Subramanian wrote:
I was fooling around a little with getdents (yes, I know that I
shouldn't be using getdents!) and found that the getdents manpage
happened to say this about struct dirent:

Yeah, you shouldn't :-)

The data in the buffer is a series of dirent structures each containing
    the following entries:

          u_int32_t d_fileno;
          u_int16_t d_reclen;
          u_int8_t  d_type;
          u_int8_t  d_namlen;
          char    d_name[MAXNAMELEN + 1]; /* see below */

    The d_fileno entry is a number which is unique for each distinct file in
    the filesystem.  Files that are linked by hard links (see link(2)) have
    the same d_fileno.  The d_reclen entry is the length, in bytes, of the
    directory record.

Yeah, this is outdated. I'm seriously thinking about just eliminiating this. Hm. We even have a partly outdated comment on sys/dirent.h...

could you please update these documents to reflect reality? i guess it's just removing d_reclen (and maybe adding the macro to calculate the length), but i'm not exactly sure.


Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \

Attachment: signature.asc
Description: OpenPGP digital signature

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]