Re: struct dirent question

[ Available lists | Index of freebsd-hackers | Month of Aug 2006 | Week of 19 Aug 2006 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Micah <micahjon@ywave.com>
Date
19 Aug 2006 23:10:10
Subject
Re: struct dirent question
Message-ID
44E79A4B.8050607@ywave.com

In reply to

[ Hide this part ]
M. Warner Losh wrote:
> In message: <44E3A221.1070905@ywave.com>
> Micah <micahjon@ywave.com> writes:
> : #define MAXNAMLEN 255
> : char d_name[MAXNAMLEN + 1]; /* name must be no longer than
> : this */
> : #if !__BSD_VISIBLE
> : #undef MAXNAMLEN
> : #endif
> : };
> : I'm not sure if it's more readable, but it puts 255 in only one location.
>
> And if I defined MAXNAMLEN before I included this file? You can't do
> it that way :-(
>
> Warner

I stand corrected. I assumed that since any defined MAXNAMLEN's get
clobbered if __BSD_VISIBLE is set there was no desire to have a
MAXNAMLEN defined when __BSD_VISIBLE was cleared. Seems like the current
way might lead to unexpected behavior if you're trying to define a
custom MAXNAMLEN. But I haven't really hacked much kernel code yet, I
just hang out here to learn.

- Micah

Elapsed time: 0.104 seconds