summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/uname.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-01-13 14:00:10 +0000
committerCorinna Vinschen <corinna@vinschen.de>2006-01-13 14:00:10 +0000
commit71f98c4caa7ea253718fa6d5165af27feba2300c (patch)
tree9eada92df813b03f28d58275d388b9e54ce34868 /winsup/cygwin/uname.cc
parent67066cabade4f443c953da8a602a30cea1abacca (diff)
downloadcygnal-71f98c4caa7ea253718fa6d5165af27feba2300c.tar.gz
cygnal-71f98c4caa7ea253718fa6d5165af27feba2300c.tar.bz2
cygnal-71f98c4caa7ea253718fa6d5165af27feba2300c.zip
* uname.cc (uname): Concatenate a "-WOW64" to utsname's sysname
member to see when running under WOW64.
Diffstat (limited to 'winsup/cygwin/uname.cc')
-rw-r--r--winsup/cygwin/uname.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/uname.cc b/winsup/cygwin/uname.cc
index fa89373d2..3797b140d 100644
--- a/winsup/cygwin/uname.cc
+++ b/winsup/cygwin/uname.cc
@@ -36,10 +36,15 @@ uname (struct utsname *name)
build systems which think the native system is a 64 bit system. Since
we're actually running in a 32 bit environment, it looks more correct
just to use the CPU info given by WOW64. */
- BOOL is_64bit_machine = FALSE;
- if (IsWow64Process (hMainProc, &is_64bit_machine) && is_64bit_machine)
+ if (wincap.is_wow64 ())
GetNativeSystemInfo (&sysinfo);
else
+#else
+ /* But it seems ok to add a hint to the sysname, that we're running under
+ WOW64. This might give an early clue if somebody encounters problems. */
+ if (wincap.is_wow64 ())
+ strncat (name->sysname, "-WOW64",
+ sizeof name->sysname - strlen (name->sysname) - 1);
#endif
GetSystemInfo (&sysinfo);