From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jx0Vk-00082E-74 for qemu-devel@nongnu.org; Fri, 16 May 2008 10:02:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jx0Vi-00081q-Mr for qemu-devel@nongnu.org; Fri, 16 May 2008 10:02:15 -0400 Received: from [199.232.76.173] (port=49028 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jx0Vi-00081n-JW for qemu-devel@nongnu.org; Fri, 16 May 2008 10:02:14 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:41521) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jx0Vh-0007xY-WA for qemu-devel@nongnu.org; Fri, 16 May 2008 10:02:14 -0400 From: Paul Brook Subject: Re: [Qemu-devel] Use of PATH_MAX Date: Fri, 16 May 2008 15:02:10 +0100 References: <18477.36259.30442.280531@mariner.uk.xensource.com> In-Reply-To: <18477.36259.30442.280531@mariner.uk.xensource.com> MIME-Version: 1.0 Content-Type: text/plain; charset="ansi_x3.4-1968" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805161502.10631.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Ian Jackson On Friday 16 May 2008, Ian Jackson wrote: > There are a couple of places where we use PATH_MAX. I don't think > this is right. PATH_MAX is a #define specified by POSIX, SuSv3 etc. > But it isn't guaranteed to be defined or necessarily very useful. > > In particular, it may be defined to a very large value (larger than a > practical static buffer). Or on systems where the maximum pathname > length varies (for example, it depends on the underlying filesystem) > it may be not defined at all and applications which really need to > know are supposed to use pathconf. > > I think it would be better to invent a new name for the maximum path > length supported by qemu's statically-sized buffers. This would > replace both the uses of PATH_MAX (in block.c, linux-user/path.c, and > block-vvfat.c) but also direct use of (eg) 1024 in many places. Better would be to not have the static length buffers in the first place. That's the whole reason you're seeing this problem in the first place. And yes, I do have real situation where a 1024 character buffer isn't big enough. Paul