kevin writes:
> In /usr/include/sys/dirent.h I see this:
> 
> /*
>  * File-system independent directory entry.
>  */
> typedef struct dirent {
>       ino_t                  d_ino;           /* "inode number" of entry */
>       off_t                          d_off;           /* offset of disk 
> directory entry */
>       unsigned short       d_reclen;          /* length of this record */
>       char                           d_name[1];       /* name of file */
> } dirent_t;
> 
> Why the *name of file* d_name[1] have only one char?

It's a string of unspecified length -- determined by d_reclen.

(Some compilers will allow either '[]' or '[0]' in a structure for
this case, but that's not compatible with older compilers.)

-- 
James Carlson, Solaris Networking              <[EMAIL PROTECTED]>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to