source: rtems/c/src/libnetworking/libc/gethostname.c @ 39e6e65a

4.104.114.84.95
Last change on this file since 39e6e65a was 39e6e65a, checked in by Joel Sherrill <joel.sherrill@…>, on 08/19/98 at 21:32:28

Base files

  • Property mode set to 100644
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 */
16int
17gethostname(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.