Revision: | 2.5 |
Committed: | Thu Jul 17 09:21:29 2003 UTC (21 years, 9 months ago) by schorsch |
Content type: | text/plain |
Branch: | MAIN |
Changes since 2.4: | +3 -1 lines |
Log Message: | Added prototypes and includes from patch by Randolph Fritz. Added more required includes and reduced other compile warnings. |
# | Content |
---|---|
1 | #ifndef lint |
2 | static const char RCSid[] = "$Id: myhostname.c,v 2.4 2003/07/14 20:02:29 schorsch Exp $"; |
3 | #endif |
4 | /* |
5 | * Query system for host name |
6 | */ |
7 | |
8 | #include "copyright.h" |
9 | |
10 | #include <unistd.h> |
11 | |
12 | #include "rtmisc.h" |
13 | |
14 | char * |
15 | myhostname() |
16 | { |
17 | static char hostname[65]; |
18 | |
19 | if (!hostname[0]) |
20 | gethostname(hostname, sizeof(hostname)); |
21 | return(hostname); |
22 | } |
23 |