| 1 |
– |
/* Copyright (c) 1996 Regents of the University of California */ |
| 2 |
– |
|
| 1 |
|
#ifndef lint |
| 2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 6 |
– |
|
| 4 |
|
/* |
| 5 |
|
* Query system for host name |
| 6 |
|
*/ |
| 7 |
|
|
| 8 |
< |
#ifndef BSD |
| 8 |
> |
#include "copyright.h" |
| 9 |
|
|
| 10 |
< |
#include <sys/utsname.h> |
| 11 |
< |
|
| 15 |
< |
char * |
| 16 |
< |
myhostname() |
| 17 |
< |
{ |
| 18 |
< |
static struct utsname nambuf; |
| 19 |
< |
|
| 20 |
< |
if (!nambuf.nodename[0]) |
| 21 |
< |
uname(&nambuf); |
| 22 |
< |
return(nambuf.nodename); |
| 23 |
< |
} |
| 24 |
< |
|
| 10 |
> |
#ifdef _WIN32 |
| 11 |
> |
#include <winsock.h> |
| 12 |
|
#else |
| 13 |
+ |
#include <unistd.h> |
| 14 |
+ |
#endif |
| 15 |
|
|
| 16 |
+ |
#include "rtmisc.h" |
| 17 |
+ |
|
| 18 |
|
char * |
| 19 |
|
myhostname() |
| 20 |
|
{ |
| 25 |
|
return(hostname); |
| 26 |
|
} |
| 27 |
|
|
| 37 |
– |
#endif |