7 |
|
|
8 |
|
#include "copyright.h" |
9 |
|
|
10 |
< |
#ifndef BSD |
10 |
> |
#if defined(_WIN32) || defined(_WIN64) |
11 |
> |
#include <winsock2.h> |
12 |
> |
#else |
13 |
> |
#include <unistd.h> |
14 |
> |
#endif |
15 |
|
|
16 |
< |
#include <sys/utsname.h> |
16 |
> |
#include "rtmisc.h" |
17 |
|
|
18 |
< |
char * |
18 |
> |
extern char * |
19 |
|
myhostname() |
20 |
|
{ |
17 |
– |
static struct utsname nambuf; |
18 |
– |
|
19 |
– |
if (!nambuf.nodename[0]) |
20 |
– |
uname(&nambuf); |
21 |
– |
return(nambuf.nodename); |
22 |
– |
} |
23 |
– |
|
24 |
– |
#else |
25 |
– |
|
26 |
– |
char * |
27 |
– |
myhostname() |
28 |
– |
{ |
21 |
|
static char hostname[65]; |
22 |
|
|
23 |
|
if (!hostname[0]) |
25 |
|
return(hostname); |
26 |
|
} |
27 |
|
|
36 |
– |
#endif |