Date: Mon, 19 Feb 2001 11:07:20 -0800 (PST) From: Mikko Tyolajarvi <mikko@dynas.se> To: dillon@earth.backplane.com Cc: hackers@freebsd.org Subject: Re: Staticaly allocated buffers in library. Is it correct? Message-ID: <200102191907.f1JJ7KU66271@explorer.rsa.com> References: <200102191723.f1JHNII37074@earth.backplane.com>
index | next in thread | previous in thread | raw e-mail
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 <milunovic@sendmail.ru> 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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102191907.f1JJ7KU66271>
