bug-gnulib
[Top][All Lists]
Advanced

[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: Wed, 1 Apr 2009 13:39:05 +0200
User-agent: KMail/1.9.9

Simon Josefsson wrote:
> POSIX requires this symbol, but MinGW doesn't appear to define it:
> 
> ../../../../src/gss-0.1.1/lib/krb5/name.c:89: error: 'HOST_NAME_MAX' 
> undeclared (first use in this function)
> 
> According to MSDN gethostname documentation:
> 
> http://msdn.microsoft.com/en-us/library/ms738527.aspx
> 
> "So if a buffer of 256 bytes is passed in the name parameter and the
> namelen parameter is set to 256, the buffer size will always be
> adequate."
> 
> Thus it seems we could define HOST_NAME_MAX to 256 on mingw?

Seems so, yes.

> One complication is that POSIX says the symbol should be defined in
> limits.h.  Do we need a gnulib replacement header for limits.h to be
> able to define HOST_NAME_MAX?

No, it is more convenient to define it in config.h, simply through
AC_DEFINE.

> Placing it in the existing gnulib unistd.h replacement is another idea.

This would be confusing for the user who is programming according to POSIX.

The definition can be triggered by the 'gethostname' module. I don't think
anyone will need HOST_NAME_MAX without needing the gethostname() function.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]