From owner-freebsd-arch Tue Dec 12 14:28:34 2000 From owner-freebsd-arch@FreeBSD.ORG Tue Dec 12 14:28:32 2000 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 2826A37B400; Tue, 12 Dec 2000 14:28:30 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.0/8.11.0) with ESMTP id eBCMSSs75916; Tue, 12 Dec 2000 15:28:28 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id PAA33203; Tue, 12 Dec 2000 15:28:27 -0700 (MST) Message-Id: <200012122228.PAA33203@harmony.village.org> To: Dag-Erling Smorgrav Subject: Re: Safe string formatting in the kernel Cc: assar@FreeBSD.ORG, Matt Dillon , kris@citusc.usc.edu, arch@FreeBSD.ORG In-reply-to: Your message of "12 Dec 2000 21:31:28 +0100." References: <20001211185610.A1741@citusc.usc.edu> <200012120259.eBC2xfb99004@earth.backplane.com> <5lhf4ap8cv.fsf@assaris.sics.se> <200012121825.LAA31285@harmony.village.org> Date: Tue, 12 Dec 2000 15:28:27 -0700 From: Warner Losh Sender: imp@harmony.village.org Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message Dag-Erling Smorgrav writes: : Warner Losh writes: : > Just be careful that your dynamic string growing things don't violate : > the hard limit invariants in the kernel. If it produces paths longer : > than 1023 characters, for example, it is wrong. : : Code manipulating path names would specify a hard upper limit of : MAXPATHLEN. If there's a known, realtively small, upper limit, why does allocating it dynamically buy you when you could have a static buffer? I know that it costs you a trip into the kernel malloc routines which can be quite high at times. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message