From owner-cvs-all Thu Mar 1 12:51:48 2001 Delivered-To: cvs-all@freebsd.org Received: from gw.nectar.com (gw.nectar.com [208.42.49.153]) by hub.freebsd.org (Postfix) with ESMTP id 2261637B718; Thu, 1 Mar 2001 12:51:43 -0800 (PST) (envelope-from nectar@nectar.com) Received: from hamlet.nectar.com (hamlet.nectar.com [10.0.1.102]) by gw.nectar.com (Postfix) with ESMTP id 4713818C91; Thu, 1 Mar 2001 14:51:42 -0600 (CST) Received: (from nectar@localhost) by hamlet.nectar.com (8.11.2/8.9.3) id f21Kpgc20978; Thu, 1 Mar 2001 14:51:42 -0600 (CST) (envelope-from nectar@spawn.nectar.com) Date: Thu, 1 Mar 2001 14:51:42 -0600 From: "Jacques A. Vidrine" To: Warner Losh Cc: Garrett Wollman , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/make arch.c main.c Message-ID: <20010301145142.A20573@hamlet.nectar.com> Mail-Followup-To: "Jacques A. Vidrine" , Warner Losh , Garrett Wollman , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org References: <200103011743.MAA01724@khavrinen.lcs.mit.edu> <200103010603.f2163IM00616@freefall.freebsd.org> <200103011743.MAA01724@khavrinen.lcs.mit.edu> <200103011817.f21IHZd50132@harmony.village.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200103011817.f21IHZd50132@harmony.village.org>; from imp@harmony.village.org on Thu, Mar 01, 2001 at 11:17:35AM -0700 X-Url: http://www.nectar.com/ Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Mar 01, 2001 at 11:17:35AM -0700, Warner Losh wrote: > In message <200103011743.MAA01724@khavrinen.lcs.mit.edu> Garrett Wollman writes: > : < said: > : > : > MAXPATHLEN includes the trailing NUL. > : > : Should have also changed the code to use PATH_MAX instead of > : MAXPATHLEN. > > OK. Can you give me a pointer to the definition of PATH_MAX in a > standards doc so I do it right? ISO/IEC 9945-1:1996 (POSIX.1) sections 2.8.2, 2.8.5, and tables 2.3, 2.6 give us this: {_POSIX_PATH_MAX} ``The number of bytes in a pathname.'' Must be defined as 255 in . We have this already. {PATH_MAX} ``Maximum number of bytes in a pathname (not a string length; count excludes a terminating null).'' Must be at least {_POSIX_PATH_MAX} if defined in . We have this already (via syslimits.h). On some systems, {PATH_MAX} may not be defined in , in which case you either have to assume {_POSIX_PATH_MAX} or use pathconf() to find the ``real'' value. This is to support the case where the maximum path length can vary from one filesystem to another, for example. Note that {PATH_MAX} _does not_ include a terminating null, and that in sys/param.h we define MAXPATHLEN = PATH_MAX. A quick look through the sources reveals lots & lots of `bugs' due to this. Hope this helps. Cheers, -- Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message