Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/uname.cc')
-rw-r--r--winsup/cygwin/uname.cc26
1 files changed, 18 insertions, 8 deletions
diff --git a/winsup/cygwin/uname.cc b/winsup/cygwin/uname.cc
index b73dc970f..de7b9000c 100644
--- a/winsup/cygwin/uname.cc
+++ b/winsup/cygwin/uname.cc
@@ -1,6 +1,6 @@
/* uname.cc
- Copyright 1996, 1997, 1998, 1999, 2000, 2001 Red Hat, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
Written by Steve Chamberlain of Cygnus Support, sac@cygnus.com
Rewritten by Geoffrey Noer of Cygnus Solutions, noer@cygnus.com
@@ -24,7 +24,7 @@ uname (struct utsname *name)
if (check_null_invalid_struct_errno (name))
return -1;
-
+
char *snp = strstr (cygwin_version.dll_build_date, "SNP");
memset (name, 0, sizeof (*name));
@@ -57,13 +57,23 @@ uname (struct utsname *name)
{
case PROCESSOR_ARCHITECTURE_INTEL:
unsigned int ptype;
- if (sysinfo.dwProcessorType < 3) /* Shouldn't happen. */
- ptype = 3;
- else if (sysinfo.dwProcessorType > 9) /* P4 */
- ptype = 6;
+ if (wincap.has_valid_processorlevel ())
+ {
+ if (sysinfo.wProcessorLevel < 3) /* Shouldn't happen. */
+ ptype = 3;
+ else if (sysinfo.wProcessorLevel > 9) /* P4 */
+ ptype = 6;
+ else
+ ptype = sysinfo.wProcessorLevel;
+ }
else
- ptype = sysinfo.dwProcessorType;
-
+ {
+ if (sysinfo.dwProcessorType == PROCESSOR_INTEL_386 ||
+ sysinfo.dwProcessorType == PROCESSOR_INTEL_486)
+ ptype = sysinfo.dwProcessorType / 100;
+ else
+ ptype = PROCESSOR_INTEL_PENTIUM / 100;
+ }
__small_sprintf (name->machine, "i%d86", ptype);
break;
case PROCESSOR_ARCHITECTURE_ALPHA: