lkml.org 
[lkml]   [1997]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: struct dirent in Linux 2.0
Date
From
In message from <amu@mit.edu> (Aaron M. Ucko):
> Ulrich Windl <windl@pc5234.dvm.klinik.uni-regensburg.de> writes:
> > I've found the following definition for struct dirent members:
> >
> > char d_name[MAXNAMLEN+1]; /* name of directory entry */
> > ino_t d_ino; /* file serial number */
> > short d_namlen; /* length of string in d_name */
> > short d_reclen; /* length of this record */
> >
> > Unfortunately Linux currently defines just
> >
> > long d_ino;
> > __kernel_off_t d_off;
> > unsigned short d_reclen;
> > char d_name[256]; /* We must not include limits.h! */
> >
> > I don't have the POSIX specs, but the first one claims to be POSIX. Can
> > Linux have a d_namlen, too?
>
> The first is definitely not POSIX. *All* POSIX specifies about struct
> dirent is that it contain d_name.

This is hair-splitting on terminology. BOTH are POSIX, however
they have added different locally specified additional entries.
That is, POSIX defines d_name being a char-array on which you
can do strlen() operation -- and that the string stored in it
is NUL terminated.

> --
> Aaron M. Ucko (amu@mit.edu) | For Geek Code, PGP public key, and other info,
> finger amu@monk.mit.edu. | "Kids! Bringing about Armageddon can be dangerous.
> Do not attempt it in your home." -- T. Pratchett & N. Gaiman, _Good Omens_

/Matti Aarnio <matti.aarnio@tele.fi>

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.033 / U:0.956 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site