00001 #include <unistd.h>
00002 #include "gis.h"
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "config.h"
00015
00016 #ifdef HAVE_SYS_UTSNAME_H
00017 #include <sys/utsname.h>
00018 static struct utsname attname;
00019 #endif
00020
00021 char *
00022 G__machine_name()
00023 {
00024 static char name[128];
00025
00026 *name = 0;
00027
00028 #ifdef HAVE_GETHOSTNAME
00029 gethostname(name, sizeof(name));
00030 name[sizeof(name)-1] = 0;
00031 #else
00032 #ifdef HAVE_UNAME
00033 uname (&attname);
00034 strcpy (name, attname.nodename);
00035 #endif
00036 #endif
00037
00038 return (name);
00039 }