dlls/ntdll/unix/system.c
static ULONG mhz_from_cpuinfo(void)
{
    char line[512];
    char *s, *value;
    double cmz = 0;
    FILE *f = fopen("/proc/cpuinfo", "r");
    if(f)
    {
        while (fgets(line, sizeof(line), f) != NULL)
        {
            if (!(value = strchr(line,':'))) continue;
            s = value - 1;
            while ((s >= line) && (*s == ' ' || *s == '\t')) s--;
            s[1] = 0;
            value++;
            if (!strcmp( line, "cpu MHz" ))
            {
                sscanf(value, " %lf", &cmz);
                break;
            }
        }
        fclose( f );
    }
    return cmz;
}
/* Fallback using /proc/cpuinfo for Linux systems without cpufreq. For
 * most distributions on recent enough hardware, this is only likely to
 * happen while running in virtualized environments such as QEMU. */
Fallback using /proc/cpuinfo for Linux systems without cpufreq. For
most distributions on recent enough hardware, this is only likely to
happen while running in virtualized environments such as QEMU.
Fallback using / proc / cpuinfo for Linux systems without cpufreq . For most distributions on recent enough hardware this is only likely to happen while running in virtualized environments such as QEMU .
static ULONG mhz_from_cpuinfo(void)
{
    char line[512];
    char *s, *value;
    double cmz = 0;
    FILE *f = fopen("/proc/cpuinfo", "r");
    if(f)
    {
        while (fgets(line, sizeof(line), f) != NULL)
        {
            if (!(value = strchr(line,':'))) continue;
            s = value - 1;
            while ((s >= line) && (*s == ' ' || *s == '\t')) s--;
            s[1] = 0;
            value++;
            if (!strcmp( line, "cpu MHz" ))
            {
                sscanf(value, " %lf", &cmz);
                break;
            }
        }
        fclose( f );
    }
    return cmz;
}
static ULONG mhz_from_cpuinfo ( void ) { char line [ 512 ] ; char * s , * value ; double cmz = 0 ; FILE * f = fopen ( " " , " " ) ; if ( f ) { while ( fgets ( line , sizeof ( line ) , f ) != NULL ) { if ( ! ( value = strchr ( line , ' ' ) ) ) continue ; s = value - 1 ; while ( ( s >= line ) && ( * s == ' ' || * s == ' \t ' ) ) s -- ; s [ 1 ] = 0 ; value ++ ; if ( ! strcmp ( line , " " ) ) { sscanf ( value , " " , & cmz ) ; break ; } } fclose ( f ) ; } return cmz ; }
Fallback using /proc/cpuinfo for Linux systems without cpufreq.
Fallback using / proc / cpuinfo for Linux systems without cpufreq .