From owner-freebsd-hackers Fri Oct 30 13:04:03 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA25067 for freebsd-hackers-outgoing; Fri, 30 Oct 1998 13:01:08 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA25061 for ; Fri, 30 Oct 1998 13:01:06 -0800 (PST) (envelope-from archie@whistle.com) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id NAA07289; Fri, 30 Oct 1998 13:01:03 -0800 (PST) Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3) id sma007287; Fri Oct 30 13:00:58 1998 Received: (from archie@localhost) by bubba.whistle.com (8.8.7/8.6.12) id NAA18888; Fri, 30 Oct 1998 13:00:58 -0800 (PST) From: Archie Cobbs Message-Id: <199810302100.NAA18888@bubba.whistle.com> Subject: Re: scanf in the kernel? In-Reply-To: <199810301814.KAA16349@bubba.whistle.com> from Archie Cobbs at "Oct 30, 98 10:14:45 am" To: mike@smith.net.au Date: Fri, 30 Oct 1998 13:00:58 -0800 (PST) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL38 (25)] 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 Archie Cobbs writes: > > 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. Also- Seems like the kernel was missing memmove(), memcpy(), and/or memset() at some point. I like using these better than bcopy()/bzero() because they are more ANSI and portable... And what about snprintf()? Would that be hard to add to the existing printf() functionality? The kernel is definitely one place you don't want to overflow string buffers... -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message