Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Sep 2006 12:54:09 +0200 (CEST)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        julian@elischer.org (Julian Elischer)
Cc:        freebsd-current@freebsd.org
Subject:   Re: suggested addition to 'date'
Message-ID:  <200609041054.k84As9JR075576@lurza.secnetix.de>
In-Reply-To: <44F892AE.8040409@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help

Julian Elischer wrote:
 > Oliver Fromme wrote:
 > > Julian Elischer wrote:
 > > > [...]
 > > > What is the effective maximum line length for a single fgetln?
 > > 
 > > It's unlimited.  fgetln() allocates sufficient amount of
 > > memory dynamically, that's why I used it instead of fgets().
 > > It avoids reinventing the wheel.
 > 
 > NOTHING is unlimitted.

I didn't think that I realy have to mention this explicitly,
but ...  Of course it is limited by the total amount of
available memory (RAM + swap), and of course it is subject
to process resource limits (maxdsize etc.).

 > what happens with a 3GB sequence of characters with no newlines?

If you have a sufficient amount of memory and process
recource limits, it will work just fine.  Otherwise
it will break out of the loop.  Admittedly it should
print an error message in that case (easy to add).

A 3GB sequence of characters with no newline should be
quite uncommon.  I think the syslog protocol even has
a limit of 1024 characters per line, I think.

Best regards
   Oliver

-- 
Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

Perl is worse than Python because people wanted it worse.
        -- Larry Wall



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609041054.k84As9JR075576>