From owner-freebsd-current@FreeBSD.ORG Mon Sep 4 10:54:32 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8602C16A4DA; Mon, 4 Sep 2006 10:54:32 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id D555C43D58; Mon, 4 Sep 2006 10:54:31 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (spslgh@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k84AsAAi075577; Mon, 4 Sep 2006 12:54:19 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k84As9JR075576; Mon, 4 Sep 2006 12:54:09 +0200 (CEST) (envelope-from olli) From: Oliver Fromme Message-Id: <200609041054.k84As9JR075576@lurza.secnetix.de> To: julian@elischer.org (Julian Elischer) Date: Mon, 4 Sep 2006 12:54:09 +0200 (CEST) In-Reply-To: <44F892AE.8040409@elischer.org> X-Mailer: ELM [version 2.5 PL8] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Mon, 04 Sep 2006 12:54:20 +0200 (CEST) X-Mailman-Approved-At: Mon, 04 Sep 2006 12:35:16 +0000 Cc: freebsd-current@freebsd.org Subject: Re: suggested addition to 'date' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Sep 2006 10:54:32 -0000 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