Release 960131
[wine/multimedia.git] / miscemu / cpu.c
bloba17f63505cb12e22802a183e1832d07f2416c113
1 /*
2 * What processor?
4 * Copyright 1995 Morten Welinder
5 */
7 #include <stdio.h>
8 #include <ctype.h>
9 #include <string.h>
10 #include "windows.h"
12 int runtime_cpu (void)
14 static int cache = 0;
16 #ifdef linux
17 if (!cache)
19 FILE *f = fopen ("/proc/cpuinfo", "r");
21 cache = 3; /* Default. */
23 if (f)
25 char info[5], value[5];
26 while (fscanf (f, " %4s%*s : %4s%*s", info, value) == 2)
27 if (!lstrcmpi (info, "cpu"))
29 if (isdigit (value[0]) && value[1] == '8'
30 && value[2] == '6' && value[3] == 0)
32 cache = value[0] - '0';
33 break;
36 fclose (f);
39 return cache;
40 #else
41 /* FIXME: how do we do this on other systems? */
42 return 3;
43 #endif