From owner-freebsd-net Mon Mar 12 17:47:40 2001 Delivered-To: freebsd-net@freebsd.org Received: from Awfulhak.org (awfulhak.demon.co.uk [194.222.196.252]) by hub.freebsd.org (Postfix) with ESMTP id 2E1B037B718 for ; Mon, 12 Mar 2001 17:47:36 -0800 (PST) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.2/8.11.2) with ESMTP id f2D1mRC10854; Tue, 13 Mar 2001 01:48:27 GMT (envelope-from brian@lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.3/8.11.3) with ESMTP id f2D1nQB08449; Tue, 13 Mar 2001 01:49:26 GMT (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200103130149.f2D1nQB08449@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Garrett Wollman Cc: net@FreeBSD.org, freebsd-standards@bostonradio.org, brian@Awfulhak.org Subject: Re: MAXHOSTNAMELEN redux In-Reply-To: Message from Garrett Wollman of "Mon, 12 Mar 2001 13:13:22 EST." <200103121813.NAA61145@khavrinen.lcs.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 13 Mar 2001 01:49:26 +0000 From: Brian Somers Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Just some ramblings.... I find this a bit odd. I concluded recently that NAME_MAX was the odd-one-out WRT not having the NUL only because it is the maximum size of a *component* of a path. When the value is used, it makes sense to talk in terms of the without-NUL value. This change seems to make it even more likely that people will forget whether MUMBLE_MAX includes the NUL or not. If I were defining this sort of thing (hah!), I'd have *_LEN as definitions without NULs and *_SIZE as definitions with the NUL. *_MAX seems to be used more commonly as the maximum number of something (ARG_MAX, CHILD_MAX), so NAME_MAX seems to be a misspelt version of NAME_CHARS_MAX.... ditto for PATH_MAX and probably others. Ok, I'm done :-) > My bug report against the current POSIX draft was accepted. For the > record, here are the changes being made. (``The indicated line'' is > referring to a line in the definition of gethostname() where the > length of the buffer was previously defined to be 256, including the > terminating null. The excluding-null semantics were chosen for > parallel construction with {NAME_MAX} and similar constants. > > At the indicated line, for 255 substitute {HOST_NAME_MAX}. > At XBD page 261 () before line 8966 insert: > > {HOST_NAME_MAX} > Maximum length of a host name (not including the terminating > null) as returned from the gethostname() function. > Minimum acceptable value: {_POSIX_HOST_NAME_MAX} > > Before line 9183, insert: > > {_POSIX_HOST_NAME_MAX} > Maximum length of a host name (not including the terminating > null) as returned from the gethostname() function. > Value: 255 > > At XBD page 424 () before line 14818 insert: > > _SC_HOST_NAME_MAX > > At XSH page 1982 (sysconf()) before line 45530 insert: > > {HOST_NAME_MAX} _SC_HOST_NAME_MAX > > I include the last two changes for completeness only; I do not > believe that applications are likely to use the sysconf() interface > for this purpose. > > -GAWollman -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message