File: hostname.c

package info (click to toggle)
safecat 1.8-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 516 kB
  • ctags: 250
  • sloc: ansic: 1,920; makefile: 371; sh: 282
file content (13 lines) | stat: -rw-r--r-- 487 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* Copyright (c) 2000, Len Budney. See COPYING for details. */
#include "hostname.h"
#include "strerr.h"
#include <unistd.h>

/* ****************************************************************** */
void get_hostname(char *hostnam, size_t len) {
  if(gethostname(hostnam, len) == 0) return;

  /* Fatal error if we can't read the hostname. */
  strerr_die1sys(111, "safecat: fatal: can't determine hostname: ");
}
/* ****************************************************************** */