diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-08-19 21:32:28 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-08-19 21:32:28 +0000 |
commit | 39e6e65a2c5a3312f365d59f23c469641e049c82 (patch) | |
tree | c0d6000a18918db140589a84596a8dfc215a4ced /cpukit/libnetworking/libc/gethostname.c | |
parent | First version produced. (diff) | |
download | rtems-39e6e65a2c5a3312f365d59f23c469641e049c82.tar.bz2 |
Base files
Diffstat (limited to 'cpukit/libnetworking/libc/gethostname.c')
-rw-r--r-- | cpukit/libnetworking/libc/gethostname.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cpukit/libnetworking/libc/gethostname.c b/cpukit/libnetworking/libc/gethostname.c new file mode 100644 index 0000000000..5b8e85acf9 --- /dev/null +++ b/cpukit/libnetworking/libc/gethostname.c @@ -0,0 +1,22 @@ +#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); +} |