From owner-freebsd-hackers Fri Oct 30 18:02:46 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA23887 for freebsd-hackers-outgoing; Fri, 30 Oct 1998 18:02:46 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA23879 for ; Fri, 30 Oct 1998 18:02:42 -0800 (PST) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id MAA01129; Sat, 31 Oct 1998 12:32:37 +1030 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.1/8.9.0) id MAA28332; Sat, 31 Oct 1998 12:32:35 +1030 (CST) Message-ID: <19981031123234.A5846@freebie.lemis.com> Date: Sat, 31 Oct 1998 12:32:34 +1030 From: Greg Lehey To: Archie Cobbs , mike@smith.net.au Cc: hackers@FreeBSD.ORG Subject: Re: scanf in the kernel? References: <199810301814.KAA16349@bubba.whistle.com> <199810302100.NAA18888@bubba.whistle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <199810302100.NAA18888@bubba.whistle.com>; from Archie Cobbs on Fri, Oct 30, 1998 at 01:00:58PM -0800 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Friday, 30 October 1998 at 13:00:58 -0800, Archie Cobbs wrote: > 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... I don't see that that's an issue within the kernel. > 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... One thing I *could* do with (and will do if people agree) is a %qd modifier for kernel *printf. I need that for vinum, and I currently have a horrible kludge to do it. Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message