version 1.115, 2015/10/14 13:50:22 |
version 1.116, 2015/11/15 06:19:22 |
|
|
#include <sys/param.h> /* MACHINE MACHINE_ARCH */ |
#include <sys/param.h> /* MACHINE MACHINE_ARCH */ |
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
#ifndef MAKE_BOOTSTRAP |
|
#include <sys/utsname.h> |
#include <sys/utsname.h> |
#endif |
|
#include <err.h> |
#include <err.h> |
#include <errno.h> |
#include <errno.h> |
#include <stdio.h> |
#include <stdio.h> |
|
|
{ |
{ |
char *r = getenv("MACHINE"); |
char *r = getenv("MACHINE"); |
if (r == NULL) { |
if (r == NULL) { |
#ifndef MAKE_BOOTSTRAP |
|
static struct utsname utsname; |
static struct utsname utsname; |
|
|
if (uname(&utsname) == -1) { |
if (uname(&utsname) == -1) { |
|
|
exit(2); |
exit(2); |
} |
} |
r = utsname.machine; |
r = utsname.machine; |
#else |
|
r = MACHINE; |
|
#endif |
|
} |
} |
return r; |
return r; |
} |
} |