Revision: | 2.4 |
Committed: | Mon Jul 14 20:02:29 2003 UTC (21 years, 9 months ago) by schorsch |
Content type: | text/plain |
Branch: | MAIN |
Changes since 2.3: | +2 -17 lines |
Log Message: | Moved some more platform dependencies to common header files. Included a few necessary system headers. |
# | Content |
---|---|
1 | #ifndef lint |
2 | static const char RCSid[] = "$Id: myhostname.c,v 2.3 2003/02/25 02:47:21 greg Exp $"; |
3 | #endif |
4 | /* |
5 | * Query system for host name |
6 | */ |
7 | |
8 | #include "copyright.h" |
9 | |
10 | #include <unistd.h> |
11 | |
12 | char * |
13 | myhostname() |
14 | { |
15 | static char hostname[65]; |
16 | |
17 | if (!hostname[0]) |
18 | gethostname(hostname, sizeof(hostname)); |
19 | return(hostname); |
20 | } |
21 |