lkml.org 
[lkml]   [1997]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: struct dirent in Linux 2.0
Date
Ulrich Windl once wrote:
>
> Hello,
>
> 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?
>

I asked this before and it was pointed out to me that d_name is '\0'
terminated so strlen(d->d_name) works on Linux and other platforms just as
well.

--
_. _ .
(_ ,_ _ , . / ` _ _L | Email: Oleg Kibirev <snowcat@netgate.net>
._)| U(_)\/\/ \_,(_L/L | Visit http://math.math.CSUFresno.EDU/~oleg/math.html
------------------------' to get my programs + PGP public key

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