mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=11937
This commit is contained in:
parent
2ae5cc3f5d
commit
d1c01f5cdd
|
@ -971,3 +971,11 @@ David 22 Jan 2007
|
||||||
|
|
||||||
lib/
|
lib/
|
||||||
app_ipc.C
|
app_ipc.C
|
||||||
|
|
||||||
|
Charlie 23 Jan 2007
|
||||||
|
- CC: Update the HOST_INFO for Intel and PowerPC Macs per David's
|
||||||
|
and Rom's instructions.
|
||||||
|
|
||||||
|
client/
|
||||||
|
hostinfo_unix.C
|
||||||
|
|
||||||
|
|
|
@ -321,6 +321,7 @@ int HOST_INFO::get_host_info() {
|
||||||
int mib[2];
|
int mib[2];
|
||||||
unsigned int mem_size;
|
unsigned int mem_size;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
#ifndef __APPLE__
|
||||||
|
|
||||||
// Get machine
|
// Get machine
|
||||||
mib[0] = CTL_HW;
|
mib[0] = CTL_HW;
|
||||||
|
@ -333,6 +334,7 @@ int HOST_INFO::get_host_info() {
|
||||||
mib[1] = HW_MODEL;
|
mib[1] = HW_MODEL;
|
||||||
len = sizeof(p_model);
|
len = sizeof(p_model);
|
||||||
sysctl(mib, 2, &p_model, &len, NULL, 0);
|
sysctl(mib, 2, &p_model, &len, NULL, 0);
|
||||||
|
#endif // ! __APPLE__
|
||||||
#else
|
#else
|
||||||
// Tru64 UNIX.
|
// Tru64 UNIX.
|
||||||
// 2005-12-26 SMS.
|
// 2005-12-26 SMS.
|
||||||
|
@ -514,16 +516,58 @@ int HOST_INFO::get_host_info() {
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
len = sizeof(p_capabilities);
|
char brand_string[256], capabilities[256];
|
||||||
sysctlbyname("machdep.cpu.features", p_capabilities, &len, NULL, 0);
|
int family, stepping, model;
|
||||||
|
int p_model_size = sizeof(p_model);
|
||||||
|
|
||||||
|
len = sizeof(p_vendor);
|
||||||
|
sysctlbyname("machdep.cpu.vendor", p_vendor, &len, NULL, 0);
|
||||||
|
|
||||||
|
len = sizeof(brand_string);
|
||||||
|
sysctlbyname("machdep.cpu.brand_string", brand_string, &len, NULL, 0);
|
||||||
|
|
||||||
|
len = sizeof(family);
|
||||||
|
sysctlbyname("machdep.cpu.family", &family, &len, NULL, 0);
|
||||||
|
|
||||||
|
len = sizeof(model);
|
||||||
|
sysctlbyname("machdep.cpu.model", &model, &len, NULL, 0);
|
||||||
|
|
||||||
|
len = sizeof(stepping);
|
||||||
|
sysctlbyname("machdep.cpu.stepping", &stepping, &len, NULL, 0);
|
||||||
|
|
||||||
|
len = sizeof(capabilities);
|
||||||
|
sysctlbyname("machdep.cpu.features", capabilities, &len, NULL, 0);
|
||||||
|
|
||||||
|
snprintf(p_model, p_model_size, "%s [x86 Family %d Model %d Stepping %d] [%s]",
|
||||||
|
brand_string, family, model, stepping, capabilities);
|
||||||
|
|
||||||
#else // PowerPC
|
#else // PowerPC
|
||||||
|
char capabilities[256], model[256];
|
||||||
|
int p_model_size = sizeof(p_model);
|
||||||
int response = 0;
|
int response = 0;
|
||||||
int retval;
|
int retval;
|
||||||
len = sizeof(response);
|
len = sizeof(response);
|
||||||
|
safe_strcpy(p_vendor, "Power Macintosh");
|
||||||
retval = sysctlbyname("hw.optional.altivec", &response, &len, NULL, 0);
|
retval = sysctlbyname("hw.optional.altivec", &response, &len, NULL, 0);
|
||||||
if (response && (!retval))
|
if (response && (!retval))
|
||||||
safe_strcpy(p_capabilities, "AltiVec");
|
safe_strcpy(capabilities, "AltiVec");
|
||||||
|
|
||||||
|
len = sizeof(model);
|
||||||
|
sysctlbyname("hw.model", model, &len, NULL, 0);
|
||||||
|
|
||||||
|
snprintf(p_model, p_model_size, "%s [%s Model %s] [%s]", p_vendor, p_vendor, model, capabilities);
|
||||||
|
|
||||||
#endif // i386 or PowerPC
|
#endif // i386 or PowerPC
|
||||||
|
|
||||||
|
p_model[p_model_size-1] = 0;
|
||||||
|
char *in = p_model + 1;
|
||||||
|
char *out = in;
|
||||||
|
// Strip out runs of multiple spaces
|
||||||
|
do {
|
||||||
|
if ((!isspace(*(in-1))) || (!isspace(*in)))
|
||||||
|
*out++ = *in;
|
||||||
|
} while (*in++);
|
||||||
|
|
||||||
#endif // __APPLE__
|
#endif // __APPLE__
|
||||||
|
|
||||||
get_local_network_info();
|
get_local_network_info();
|
||||||
|
|
Loading…
Reference in New Issue