QNX 4.25 - Get CPU info

Hi, I need a process or application to get the CPU info, could you help me?
I need CPU type (P3,P4,586,etc) and speed.

Thanks

I’m out of town without documentation nearby, But I’m pretty sure that there is a qnx_…() routine that gives you this information
back in a structure. It also gives you specific process information.

Yes it’s qnx_osinfo() and in the structure returned there is a flag containing CPU type information.

Thanks Mario. I tried the following example:

#include <stdio.h>
#include <sys/osinfo.h>

struct _osinfo osdata;

void main()
{
if( qnx_osinfo( 0, &osdata ) != -1 )
printf( “Cpu speed is %d\n”, osdata.cpu_speed );
}

result: Cpu speed is 62942

What does this number mean?

It’s a relative number. It provides an approximate way to compare the speed of two processors, but historically it has not been very accurate. Judging the speed of a processor is very complex as issues like cache or instruction order can dramatically change the rate at which instructions are executed. I’ve never seen the algorithm published, but if you are real concerned you might check with QNX for details.