From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Wolfgang Jaehrling Newsgroups: gmane.lisp.guile.devel Subject: Re: gethostname max len Date: Mon, 22 Mar 2004 02:34:14 +0100 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <20040322013414.GB235@gmx.de> References: <87ad29on5v.fsf@zip.com.au> <20040322010510.GA235@gmx.de> <87fzc1n16o.fsf@zip.com.au> Reply-To: Wolfgang Jaehrling NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1079918890 26362 80.91.224.253 (22 Mar 2004 01:28:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 22 Mar 2004 01:28:10 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Mar 22 02:28:06 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B5EEX-0003Ge-00 for ; Mon, 22 Mar 2004 02:28:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B5EEI-000056-NB for guile-devel@m.gmane.org; Sun, 21 Mar 2004 20:27:50 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B5EDx-0008DI-9l for guile-devel@gnu.org; Sun, 21 Mar 2004 20:27:29 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B5EDC-000757-4r for guile-devel@gnu.org; Sun, 21 Mar 2004 20:27:14 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.30) id 1B5EDB-00073a-AM for guile-devel@gnu.org; Sun, 21 Mar 2004 20:26:41 -0500 Original-Received: (qmail 27406 invoked by uid 65534); 22 Mar 2004 01:26:35 -0000 Original-Received: from dialin-145-254-209-097.arcor-ip.net (EHLO kaputt.schrott) (145.254.209.97) by mail.gmx.net (mp011) with SMTP; 22 Mar 2004 02:26:35 +0100 X-Authenticated: #897519 Original-Received: from wj by kaputt.schrott with local (Exim 3.35 #1 (Debian)) id 1B5EKU-00009l-00; Mon, 22 Mar 2004 02:34:14 +0100 Original-To: Kevin Ryde Content-Disposition: inline In-Reply-To: <87fzc1n16o.fsf@zip.com.au> User-Agent: Mutt/1.3.28i X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3556 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3556 On Mon, Mar 22, 2004 at 11:02:55AM +1000, Kevin Ryde wrote: > Wolfgang Jaehrling writes: > > Which is what Guile probably also should do, otherwise it won't work > > correctly on the GNU system, which has no limit on the length of host > > names; > > Oh, is that how the -1 is to be understood? Nosing around the glibc > sources it looked only like it didn't have an implementation for > HOST_NAME_MAX yet. The GNU system deliberately defines no such limits, following the spirit of the GNU coding standards, which say (node "Semantics"): "Avoid arbitrary limits on the length of _any_ data structure, including file names, lines, files, and symbols, by allocating all data structures dynamically. In most Unix utilities, "long lines are silently truncated." This is not acceptable in a GNU utility." I'm personally quite happy if programs at least try to use constants like PATH_MAX, so that we can find these places and fix them. I really don't want to know how many programs just use arrays of size 1024 for file names. There are even manual pages out there (like realpath(3) on my GNU/Linux system) that contain examples like: #ifdef PATH_MAX path_max = PATH_MAX; #else path_max = pathconf (path, _PC_PATH_MAX); if (path_max <= 0) path_max = 4096; #endif which tries to do the right thing, but ends up doing nonsense on the GNU system (as pathconf() behaves like sysconf(), returning -1 to indicate the absence of any limit). Though I have to admit that doing the right thing in a portable way is probably more work than it should be. But that's what you get for using C instead of Scheme. :-) Cheers, Wolfgang -- Repeating false statements makes them true. Repeating false statements makes them true. Repeating false statements makes them true. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel