minix/dist/nvi/clib/gethostname.c
Lionel Sambuc 3e1db26a5a Termcap update, replacing elvis by nvi.
Removing elvis, importing nvi, ctags, updating libedit.

Change-Id: I881eb04d2dc64cf112facd992de1114e1a59107f
2013-01-24 07:44:38 +01:00

24 lines
456 B
C

/* $NetBSD: gethostname.c,v 1.1.1.2 2008/05/18 14:29:38 aymeric Exp $ */
#include "config.h"
/*
* Solaris doesn't include the gethostname call by default.
*/
#include <sys/utsname.h>
#include <sys/systeminfo.h>
#include <netdb.h>
/*
* PUBLIC: #ifndef HAVE_GETHOSTNAME
* PUBLIC: int gethostname __P((char *, int));
* PUBLIC: #endif
*/
int
gethostname(host, len)
char *host;
int len;
{
return (sysinfo(SI_HOSTNAME, host, len) == -1 ? -1 : 0);
}