source:
rtems/cpukit/libnetworking/libc/gethostname.c
@
9d647dfc
Last change on this file since 9d647dfc was 96b39164, checked in by Joel Sherrill <joel.sherrill@…>, on 08/20/98 at 21:56:40 | |
---|---|
|
|
File size: 399 bytes |
Line | |
---|---|
1 | /* |
2 | * $Id$ |
3 | */ |
4 | |
5 | #include "config.h" |
6 | |
7 | /* |
8 | * Solaris doesn't include the gethostname call by default. |
9 | */ |
10 | #include <sys/utsname.h> |
11 | #include <sys/systeminfo.h> |
12 | |
13 | #include <netdb.h> |
14 | |
15 | /* |
16 | * PUBLIC: #ifndef HAVE_GETHOSTNAME |
17 | * PUBLIC: int gethostname __P((char *, int)); |
18 | * PUBLIC: #endif |
19 | */ |
20 | int |
21 | gethostname(host, len) |
22 | char *host; |
23 | int len; |
24 | { |
25 | return (sysinfo(SI_HOSTNAME, host, len) == -1 ? -1 : 0); |
26 | } |
Note: See TracBrowser
for help on using the repository browser.