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. |
# | User | Rev | Content |
---|---|---|---|
1 | greg | 2.1 | #ifndef lint |
2 | schorsch | 2.4 | static const char RCSid[] = "$Id: myhostname.c,v 2.3 2003/02/25 02:47:21 greg Exp $"; |
3 | greg | 2.1 | #endif |
4 | /* | ||
5 | * Query system for host name | ||
6 | greg | 2.2 | */ |
7 | |||
8 | greg | 2.3 | #include "copyright.h" |
9 | greg | 2.1 | |
10 | schorsch | 2.4 | #include <unistd.h> |
11 | greg | 2.1 | |
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 |