From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 19 23:10:10 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F97216A500 for ; Sat, 19 Aug 2006 23:10:10 +0000 (UTC) (envelope-from micahjon@ywave.com) Received: from relay1.av-mx.com (relay1.av-mx.com [137.118.16.126]) by mx1.FreeBSD.org (Postfix) with ESMTP id D8FFD43D45 for ; Sat, 19 Aug 2006 23:10:09 +0000 (GMT) (envelope-from micahjon@ywave.com) X-Virus-Scan-Time: 0 Received: from [137.118.16.61] (HELO mx0.av-mx.com) by relay1.av-mx.com (CommuniGate Pro SMTP 4.2.10) with SMTP id 355687590 for freebsd-hackers@freebsd.org; Sat, 19 Aug 2006 19:10:09 -0400 Received: (qmail 2235 invoked from network); 19 Aug 2006 23:10:07 -0000 Received: from dsl25232.ywave.com (HELO ?192.168.1.65?) (micahjon@ywave.com@216.227.113.232) by 0 with SMTP; 19 Aug 2006 23:10:07 -0000 X-CLIENT-IP: 216.227.113.232 X-CLIENT-HOST: dsl25232.ywave.com Message-ID: <44E79A4B.8050607@ywave.com> Date: Sat, 19 Aug 2006 16:10:03 -0700 From: Micah User-Agent: Thunderbird 1.5.0.5 (X11/20060730) MIME-Version: 1.0 To: "M. Warner Losh" References: <44E3484D.8090905@centtech.com> <44E39DEC.1050204@uts.edu.au> <44E3A221.1070905@ywave.com> <20060819.145027.-1573946361.imp@bsdimp.com> In-Reply-To: <20060819.145027.-1573946361.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, anthony.maher@uts.edu.au Subject: Re: struct dirent question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Aug 2006 23:10:10 -0000 M. Warner Losh wrote: > In message: <44E3A221.1070905@ywave.com> > Micah 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