source: rtems/cpukit/libnetworking/libc/gethostname.c @ d8fce03

4.8
Last change on this file since d8fce03 was 09fdb5e8, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/30/07 at 05:15:58

Eliminate SCCS, LINT. Add HAVE_CONFIG_H.

  • Property mode set to 100644
File size: 424 bytes
Line 
1/*
2 *  $Id$
3 */
4
5#if HAVE_CONFIG_H
6#include "config.h"
7#endif
8
9/*
10 * Solaris doesn't include the gethostname call by default.
11 */
12#include <sys/utsname.h>
13#include <sys/systeminfo.h>
14
15#include <netdb.h>
16
17/*
18 * PUBLIC: #ifndef HAVE_GETHOSTNAME
19 * PUBLIC: int gethostname __P((char *, int));
20 * PUBLIC: #endif
21 */
22int
23gethostname(host, len)
24        char *host;
25        int len;
26{
27        return (sysinfo(SI_HOSTNAME, host, len) == -1 ? -1 : 0);
28}
Note: See TracBrowser for help on using the repository browser.