From owner-freebsd-hackers Mon Feb 19 11: 7:34 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from karon.dynas.se (karon.dynas.se [192.71.43.4]) by hub.freebsd.org (Postfix) with SMTP id CBB8D37B491 for ; Mon, 19 Feb 2001 11:07:29 -0800 (PST) Received: (qmail 21064 invoked from network); 19 Feb 2001 19:07:25 -0000 Received: from spirit.sto.dynas.se (HELO spirit.dynas.se) (172.16.1.10) by 172.16.1.1 with SMTP; 19 Feb 2001 19:07:25 -0000 Received: (qmail 12153 invoked from network); 19 Feb 2001 19:07:23 -0000 Received: from explorer.rsa.com (10.81.217.59) by spirit.dynas.se with SMTP; 19 Feb 2001 19:07:23 -0000 Received: (from mikko@localhost) by explorer.rsa.com (8.11.1/8.11.1) id f1JJ7KU66271; Mon, 19 Feb 2001 11:07:20 -0800 (PST) (envelope-from mikko) Date: Mon, 19 Feb 2001 11:07:20 -0800 (PST) From: Mikko Tyolajarvi Message-Id: <200102191907.f1JJ7KU66271@explorer.rsa.com> To: dillon@earth.backplane.com Cc: hackers@freebsd.org Subject: Re: Staticaly allocated buffers in library. Is it correct? Newsgroups: local.freebsd.hackers References: <200102191723.f1JHNII37074@earth.backplane.com> X-Newsreader: NN version 6.5.6 (NOV) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In local.freebsd.hackers you write: >: >:So, if I send problem report with my patches, I should inherit usage of >:staticaly allocated buffers. >:Am I right? >: >:milunovic wrote in message >:news:Pine.BSF.4.21.0102171202110.400-100000@scorpion.cosmos.all.net... >:> -----BEGIN PGP SIGNED MESSAGE----- >:> >:> On Fri, 16 Feb 2001, Andrey Simonenko wrote: >:> >:> > I patched some library files and noted that some functions, which parse >:some >:> > configuration files, use staticaly allocated buffers. Sizes of such >:> > staticaly allocated buffers are 8k, 10k and so on. These buffers are >:used to >:> > hold one line from parsed file. Usually it is enough for one line, but >:... > Yes. System libraries traditionally use statically allocated buffers > because, even now, there is no dynamic equivalent for fgets(). The > closest you can get is to mmap() the file and extract the lines that > way. How about fgetln(3)? /Mikko -- Mikko Työläjärvi_______________________________________mikko@rsasecurity.com RSA Security To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message