From owner-freebsd-arch Thu Aug 15 14:54:42 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97CE037B400; Thu, 15 Aug 2002 14:54:37 -0700 (PDT) Received: from snipe.mail.pas.earthlink.net (snipe.mail.pas.earthlink.net [207.217.120.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id 551D943E65; Thu, 15 Aug 2002 14:54:37 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0454.cvx21-bradley.dialup.earthlink.net ([209.179.193.199] helo=mindspring.com) by snipe.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 17fSZd-0004AQ-00; Thu, 15 Aug 2002 14:54:34 -0700 Message-ID: <3D5C22E2.33A82B55@mindspring.com> Date: Thu, 15 Aug 2002 14:53:38 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Maxime Henrion Cc: arch@FreeBSD.org, Brooks Davis Subject: Re: kernel strlcpy References: <20020815122641.B21334@Odin.AC.HMC.Edu> <20020815193028.GF14155@elvis.mu.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Maxime Henrion wrote: > Brooks Davis wrote: > > I'd like to import strlcpy into libkern. It's obviously the right > > function for setting the if_xname member of struct ifnet from the > > device. > > Yes, please! We waited far too long for this, there are a lot of places > in the kernel that really need strlcpy(). No, please. It encourages idiots to do string processing in the kernel, when you should be carrying around this crap in user space, instead. I think Linux did the right thing when they limited string copied in the kernel to file path name components. Other than "mount" (the system call that ate the world), and "sysctl" (the debug subsystem that ate the world), there's not a lot of real valid use for string manipulation in the kernel. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message