Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Oct 2016 11:17:19 +0800
From:      Erich Dollansky <erichsfreebsdlist@alogt.com>
To:        freebsd-stable@FreeBSD.org
Subject:   HOST_NAME_MAX not defined in unistd.h
Message-ID:  <20161002111719.6e22f670@X220.alogt.com>

next in thread | raw e-mail | index | archive | help
Hi,

there is a discrepancy in the documentation:

sys/syslimits.h says:

'/*
 * We leave the following values undefined to force applications to
either
 * assume conservative values or call sysconf() to get the current
value. *
 * HOST_NAME_MAX
 *
 * (We should do this for most of the values currently defined here,
 * but many programs are not prepared to deal with this yet.)
 */'

man gethostname says:

    #include <unistd.h>

and

'Host names are limited to {HOST_NAME_MAX} characters, not including
the trailing null, currently 255.'

which makes people assume that HOST_NAME_MAX is defined in unistd.h.

What is the real idea? Keep gethostname compatible to the rest or force
users to call sysconf? 

Should I file a bug report?

Erich



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161002111719.6e22f670>