From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 16 18:45:11 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 9EB5816A4E6 for ; Wed, 16 Aug 2006 18:45:11 +0000 (UTC) (envelope-from drosih@rpi.edu) Received: from smtp5.server.rpi.edu (smtp5.server.rpi.edu [128.113.2.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id D27EA43D49 for ; Wed, 16 Aug 2006 18:45:10 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp5.server.rpi.edu (8.13.1/8.13.1) with ESMTP id k7GIj6ak024162; Wed, 16 Aug 2006 14:45:07 -0400 Mime-Version: 1.0 Message-Id: In-Reply-To: <44E3484D.8090905@centtech.com> References: <44E29055.3080205@centtech.com> <20060816054925.GA11651@droopy.unibe.ch> <44E3484D.8090905@centtech.com> Date: Wed, 16 Aug 2006 14:45:05 -0400 To: Eric Anderson , Tobias Roth From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) Cc: FreeBSD Hackers 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: Wed, 16 Aug 2006 18:45:11 -0000 At 11:31 AM -0500 8/16/06, Eric Anderson wrote: > >My point was, that either path you take (if BSD_VISIBLE is >defined or not), you end up with d_name having a size of >255 + 1, so what's the point the having it at all? To make it clear that d_name is tied to the exact value of MAXNAMLEN (just in case that value ever changes), and it does not just happen to be 255+1 bytes for some reason that is completely unrelated to MAXNAMLEN. So if some programmer is working with the d_name variable, and *if* they actually look at this include file, then they'll immediately realize that any checks that they make should use MAXNAMLEN, and not hard-code in the 255 value. That's my 2-cents worth, at least... -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu