home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spezial / SPEZIAL2_97.zip / SPEZIAL2_97.iso / ANWEND / EDITOR / NVI179B / NVI179B.ZIP / clib / gethostname.c < prev    next >
C/C++ Source or Header  |  1996-06-14  |  382b  |  23 lines

  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. }
  23.