]> git.ipfire.org Git - thirdparty/util-linux.git/commit
include/c: add get_hostname_max() inline function
authorSami Kerola <kerolasa@iki.fi>
Wed, 17 Oct 2012 19:16:06 +0000 (20:16 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 19 Oct 2012 12:50:27 +0000 (14:50 +0200)
commit1ee4dff7246949cbebef884d84ccdc127450bee0
tree1af3a454706d0179a407f1813734a8b6ec2b1c57
parent0b3e1d9baef8dd7ed121c68a1a480d903fb0ad06
include/c: add get_hostname_max() inline function

Using sysconf(_SC_HOST_NAME_MAX) does not work everywhere.  At such even
header values for hostname length should be preferred, and if nothing
else works guess the maxium being 64 bytes.

Based-on-code-by: Karel Zak <kzak@redhat.com>
CC: Mike Frysinger <vapier@gentoo.org>
References: http://www.spinics.net/lists/util-linux-ng/msg07050.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
include/c.h