Back to index

radiance  4R0+20100331
myhostname.c
Go to the documentation of this file.
00001 #ifndef lint
00002 static const char    RCSid[] = "$Id: myhostname.c,v 2.7 2003/10/27 10:19:31 schorsch Exp $";
00003 #endif
00004 /*
00005  * Query system for host name
00006  */
00007 
00008 #include "copyright.h"
00009 
00010 #ifdef _WIN32
00011   #include <winsock2.h>
00012 #else
00013   #include <unistd.h>
00014 #endif
00015 
00016 #include "rtmisc.h"
00017 
00018 extern char *
00019 myhostname()
00020 {
00021        static char   hostname[65];
00022 
00023        if (!hostname[0])
00024               gethostname(hostname, sizeof(hostname));
00025        return(hostname);
00026 }
00027