[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HOST_NAME_MAX
From: |
Bruno Haible |
Subject: |
Re: HOST_NAME_MAX |
Date: |
Mon, 10 Aug 2009 16:51:34 +0200 |
User-agent: |
KMail/1.9.9 |
Simon Josefsson wrote:
> Is the maximum string ever returned by gethostname bounded by
> MAXHOSTNAMELEN?
I expect so.
> It seems clear that FreeBSD isn't POSIX compliant here since
> HOST_NAME_MAX needs to be provided, as far as I can tell.
So, FreeBSD is POSIX compliant. See [1]: HOST_NAME_MAX is inside a section
that begins with:
"A definition of one of the symbolic constants in the following list
shall be omitted from <limits.h> on specific implementations where the
corresponding value is equal to or greater than the stated minimum, but
is unspecified.
This indetermination might depend on the amount of available memory space
on a specific instance of a specific implementation. The actual value
supported by a specific instance shall be provided by the sysconf()
function."
> I guess looking into FreeBSD libc would answer this.
[2] simply makes a system call. In the kernel, it's really an access of
an array of size MAXHOSTNAMELEN [3][4].
Bruno
[1] http://www.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
[2] http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/gen/gethostname.c
[3] http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/kern_mib.c
[4] http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/sys/jail.h
- Re: HOST_NAME_MAX, Bruno Haible, 2009/08/02
- Re: HOST_NAME_MAX, Bruno Haible, 2009/08/02
- Re: HOST_NAME_MAX, Tom G. Christensen, 2009/08/06
- Re: HOST_NAME_MAX, Simon Josefsson, 2009/08/06
- Re: HOST_NAME_MAX, Bruno Haible, 2009/08/08
- Re: HOST_NAME_MAX, Simon Josefsson, 2009/08/10
- Re: HOST_NAME_MAX,
Bruno Haible <=
- Re: HOST_NAME_MAX, Simon Josefsson, 2009/08/10
- Re: HOST_NAME_MAX, Bruno Haible, 2009/08/10
- Re: HOST_NAME_MAX, Simon Josefsson, 2009/08/11
Re: HOST_NAME_MAX, Simon Josefsson, 2009/08/03