| Revision: | 2.3 |
| Committed: | Tue Feb 25 02:47:21 2003 UTC (22 years, 8 months ago) by greg |
| Content type: | text/plain |
| Branch: | MAIN |
| CVS Tags: | rad3R5 |
| Changes since 2.2: | +1 -56 lines |
| Log Message: | Replaced inline copyright notice with #include "copyright.h" |
| # | Content |
|---|---|
| 1 | #ifndef lint |
| 2 | static const char RCSid[] = "$Id$"; |
| 3 | #endif |
| 4 | /* |
| 5 | * Query system for host name |
| 6 | */ |
| 7 | |
| 8 | #include "copyright.h" |
| 9 | |
| 10 | #ifndef BSD |
| 11 | |
| 12 | #include <sys/utsname.h> |
| 13 | |
| 14 | char * |
| 15 | myhostname() |
| 16 | { |
| 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 | { |
| 29 | static char hostname[65]; |
| 30 | |
| 31 | if (!hostname[0]) |
| 32 | gethostname(hostname, sizeof(hostname)); |
| 33 | return(hostname); |
| 34 | } |
| 35 | |
| 36 | #endif |