This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
/proc/cpuinfo output differs from Linux
- From: Diego Biurrun <diego at biurrun dot de>
- To: cygwin-patches at cygwin dot com
- Date: Sat, 19 Apr 2003 00:33:58 +0200
- Subject: /proc/cpuinfo output differs from Linux
Hello!
I am an MPlayer developer and was wondering why our configure script was
suddenly failing to detect my K6-III CPU. Then I noticed that Cygwin
/proc/cpuinfo formatting is not the same as in Linux.
Cygwin:
$ cat /proc/cpuinfo
vendor id : AuthenticAMD
Linux:
lea:~$ cat /proc/cpuinfo
vendor_id : GenuineIntel
Cygwin outputs "vendor id" (with a blank), while Linux uses "vendor_id"
with an underscore. We use this information to identify processors and
set up optimizations accordingly.
I grepped through the Cygwin sources for "vendor id" and made a small
patch. It is not tested but trivial, so I expect it to be fully correct.
Regards
Diego Biurrun
2003-04-18 Diego Biurrun <diego at biurrun dot de>
* fhandler_proc.cc (format_proc_cpuinfo): Change /proc/cpuinfo "vendor id"
string to "vendor_id" to conform with Linux systems.
Index: winsup/cygwin/fhandler_proc.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler_proc.cc,v
retrieving revision 1.28
diff -u -p -r1.28 fhandler_proc.cc
--- winsup/cygwin/fhandler_proc.cc 16 Apr 2003 03:03:44 -0000 1.28
+++ winsup/cygwin/fhandler_proc.cc 18 Apr 2003 23:40:24 -0000
@@ -606,7 +606,7 @@ format_proc_cpuinfo (char *destbuf, size
{
bufptr += __small_sprintf (bufptr, "processor : %d\n", cpu_number);
read_value ("VendorIdentifier", REG_SZ);
- bufptr += __small_sprintf (bufptr, "vendor id : %s\n", szBuffer);
+ bufptr += __small_sprintf (bufptr, "vendor_id : %s\n", szBuffer);
read_value ("Identifier", REG_SZ);
bufptr += __small_sprintf (bufptr, "identifier : %s\n", szBuffer);
if (wincap.is_winnt ())
@@ -640,7 +640,7 @@ format_proc_cpuinfo (char *destbuf, size
cpuid (&maxf, &vendor_id[0], &vendor_id[2], &vendor_id[1], 0);
maxf &= 0xffff;
vendor_id[3] = 0;
- bufptr += __small_sprintf (bufptr, "vendor id : %s\n", (char *)vendor_id);
+ bufptr += __small_sprintf (bufptr, "vendor_id : %s\n", (char *)vendor_id);
unsigned cpu_mhz = 0;
if (wincap.is_winnt ())
{