mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-09 00:53:16 +00:00
27 lines
399 B
C
27 lines
399 B
C
/*
|
|
* $Id$
|
|
*/
|
|
|
|
#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);
|
|
}
|