I'm trying to get some information on the processor using the mach interfaces, and getting some weird results and wondering if anyone knows why? The function I am using is as follows: kern_return_t get_host_processors(void) { kern_return_t result; processor_array_t procArray; mach_msg_type_number_t procCount; processor_basic_info_data_t procInfo; mach_msg_type_number_t infoSize; host_t thisHost; host_priv_t thisPrivHost; unsigned long index; thisHost = (host_t) host_self(); thisPrivHost = (host_priv_t) host_priv_self(); /* * Host Processors */ result = host_processors(thisPrivHost, &procArray, &procCount); printf("\nhost_processors result = %08x\n", result); if (result == KERN_SUCCESS) { printf("size of procArray = %08x\n", procCount); for (index = 0; index < procCount; index++) { infoSize = PROCESSOR_BASIC_INFO_COUNT; result = processor_info( procArray[index], PROCESSOR_BASIC_INFO, &thisHost, (processor_info_t) &procInfo, &infoSize); printf("\n processor_info result = %08x\n", result); if (result == KERN_SUCCESS) { printf("procArray[ %ld ] = %08x\n", index, (int)(procArray[index])); printf("size of procInfo = %08x\n", infoSize); printf("procInfo.slot_num = %08x\n", procInfo.slot_num); printf("procInfo.is_master = %08x\n", procInfo.is_master); } } } return (result); } For some reason the call to processor info always returns 0, and a valid infoSize, but all the data is always nil. Thanks. Brad _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Brad Post