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