From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 16 18:48:05 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 2A92416A4DD for ; Wed, 16 Aug 2006 18:48:05 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh2.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5581443D5C for ; Wed, 16 Aug 2006 18:48:01 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh2.centtech.com (8.13.1/8.13.1) with ESMTP id k7GIm0ib095899; Wed, 16 Aug 2006 13:48:00 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44E36877.30707@centtech.com> Date: Wed, 16 Aug 2006 13:48:23 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.5 (X11/20060802) MIME-Version: 1.0 To: Garance A Drosihn References: <44E29055.3080205@centtech.com> <20060816054925.GA11651@droopy.unibe.ch> <44E3484D.8090905@centtech.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1671/Wed Aug 16 10:29:02 2006 on mh2.centtech.com X-Virus-Status: Clean Cc: FreeBSD Hackers , Tobias Roth 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:48:05 -0000 On 08/16/06 13:45, Garance A Drosihn wrote: > 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... > Then shouldn't both be set to MAXNAMLEN? Of course, it isn't a big deal, I'm just curious what I'm missing in the reasoning for doing such a thing. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------