#include "c.h"
#include <sys/utsname.h>
Go to the source code of this file.
Functions | |
int | gethostname (char *name, int namelen) |
int gethostname | ( | char * | name, | |
int | namelen | |||
) |
Definition at line 20 of file gethostname.c.
{ static struct utsname mname; static int called = 0; if (!called) { called++; uname(&mname); } strncpy(name, mname.nodename, (SYS_NMLN < namelen ? SYS_NMLN : namelen)); return 0; }