Re: Determine clock speed
barts_at_smaalders.net
Date: 01/29/05
- Next message: GreyCloud: "Re: Studio 10 compilers for Solaris released"
- Previous message: barts_at_smaalders.net: "Re: so_socket ?"
- In reply to: Peter C. Tribble: "Re: Determine clock speed"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Jan 2005 19:40:18 -0800
Do keep in mind:
1) Processor 0 may not be there.
2) Processors can and may be of different speeds.
3) you may not be able to run on all processor you can list.
Some code to find legal processor ids from the p_online man page:
#include <sys/unistd.h>
#include <sys/processor.h>
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
int
main()
{
processorid_t i, cpuid_max;
cpuid_max = sysconf(_SC_CPUID_MAX);
for (i = 0; i <= cpuid_max; i++) {
if (p_online(i, P_STATUS) != -1)
printf("processor %d present\n", i);
}
return (0);
}
- Next message: GreyCloud: "Re: Studio 10 compilers for Solaris released"
- Previous message: barts_at_smaalders.net: "Re: so_socket ?"
- In reply to: Peter C. Tribble: "Re: Determine clock speed"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|