gethostname() is more a BSD feature than an XOPEN one.