From owner-freebsd-hackers Sun Nov 1 13:47:06 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA11227 for freebsd-hackers-outgoing; Sun, 1 Nov 1998 13:47:06 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp03.primenet.com (smtp03.primenet.com [206.165.6.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA11221 for ; Sun, 1 Nov 1998 13:47:04 -0800 (PST) (envelope-from tlambert@usr05.primenet.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.8.8/8.8.8) id OAA11898; Sun, 1 Nov 1998 14:46:59 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp03.primenet.com, id smtpd011884; Sun Nov 1 14:46:54 1998 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id OAA27534; Sun, 1 Nov 1998 14:46:38 -0700 (MST) From: Terry Lambert Message-Id: <199811012146.OAA27534@usr05.primenet.com> Subject: Re: scanf in the kernel? To: mike@smith.net.au (Mike Smith) Date: Sun, 1 Nov 1998 21:46:38 +0000 (GMT) Cc: hackers@FreeBSD.ORG In-Reply-To: <199810300813.AAA01726@dingo.cdrom.com> from "Mike Smith" at Oct 30, 98 00:13:48 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Just wondering what the general feeling would be about having scanf in > the kernel? As we move towards more abstract representations of things > (eg. device names), it's becoming more important to be able to parse > strings inside the kernel. > > Doing this in hand-rolled code is tedious, error-prone and results in > code that can be hard to read and maintain (as everyone does it their > own way). > > If this isn't totally repulsive, I'll roll a somewhat smaller version > of the libc vfscanf for general approval. I have to say that it's repulsive. In general, the only place strings should probably be used in the kernel at all are in filesystem namespace exposures. Even then, I have to say that NFS is utterly bogus in the use of pushing strings across the user/kernel boundary for the exported FS list. In general, I have to say that I rather like the fact that Linux has one use of copyinstr -- and does nto have a general copyinstr as a result, but only a copy in for the path data for an FS path lookup. I think it is a mistake for FreeBSD to turn into Plan9. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message