hostname.c 340 B

12345678910111213141516171819
  1. /* See LICENSE file for copyright and license details. */
  2. #include <err.h>
  3. #include <stdio.h>
  4. #include <unistd.h>
  5. #include "../lib/util.h"
  6. void
  7. hostname(char *out,
  8. const char __unused *_a,
  9. uint32_t __unused _i,
  10. void __unused *_p)
  11. {
  12. if (gethostname(out, BUFF_SZ) < 0) {
  13. warnx("gethostbyname");
  14. ERRRET(out);
  15. }
  16. }