Revision: | 2.7 |
Committed: | Mon Oct 27 10:19:31 2003 UTC (21 years, 6 months ago) by schorsch |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | rad4R2P2, rad5R0, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1 |
Changes since 2.6: | +3 -3 lines |
Log Message: | Added gethomedir.c and various compatibility fixes. |
# | Content |
---|---|
1 | #ifndef lint |
2 | static const char RCSid[] = "$Id: myhostname.c,v 2.6 2003/10/21 02:02:31 schorsch Exp $"; |
3 | #endif |
4 | /* |
5 | * Query system for host name |
6 | */ |
7 | |
8 | #include "copyright.h" |
9 | |
10 | #ifdef _WIN32 |
11 | #include <winsock2.h> |
12 | #else |
13 | #include <unistd.h> |
14 | #endif |
15 | |
16 | #include "rtmisc.h" |
17 | |
18 | extern char * |
19 | myhostname() |
20 | { |
21 | static char hostname[65]; |
22 | |
23 | if (!hostname[0]) |
24 | gethostname(hostname, sizeof(hostname)); |
25 | return(hostname); |
26 | } |
27 |