From owner-freebsd-hackers Mon Feb 19 12:44:34 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id 3199837B4EC for ; Mon, 19 Feb 2001 12:44:32 -0800 (PST) Received: (from dillon@localhost) by earth.backplane.com (8.11.2/8.9.3) id f1JKiRT38061; Mon, 19 Feb 2001 12:44:27 -0800 (PST) (envelope-from dillon) Date: Mon, 19 Feb 2001 12:44:27 -0800 (PST) From: Matt Dillon Message-Id: <200102192044.f1JKiRT38061@earth.backplane.com> To: Mikko Tyolajarvi Cc: hackers@freebsd.org Subject: Re: Staticaly allocated buffers in library. Is it correct? References: <200102191723.f1JHNII37074@earth.backplane.com> <200102191907.f1JJ7KU66271@explorer.rsa.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :>:> > 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 Sure, if all you want to do is compile your program on a *BSD box. But fgetln() is a stupid function... it doesn't return a nul-terminated string, for example. It's a bad hack. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message