struct dirent question

Eric Anderson anderson at centtech.com
Wed Aug 16 03:25:52 UTC 2006


Does the ifdef in the struct dirent (pasted in below) make any sense? 
Seems like regardless of whether the __BSD_VISIBLE is defined or not, 
the d_name length will always be 255 + 1.

Eric


struct dirent {
         __uint32_t d_fileno;            /* file number of entry */
         __uint16_t d_reclen;            /* length of this record */
         __uint8_t  d_type;              /* file type, see below */
         __uint8_t  d_namlen;            /* length of string in d_name */
#if __BSD_VISIBLE
#define MAXNAMLEN       255
         char    d_name[MAXNAMLEN + 1];  /* name must be no longer than 
this */
#else
         char    d_name[255 + 1];        /* name must be no longer than 
this */
#endif
};

-- 
------------------------------------------------------------------------
Eric Anderson        Sr. Systems Administrator        Centaur Technology
Anything that works is better than anything that doesn't.
------------------------------------------------------------------------


More information about the freebsd-hackers mailing list