[PATCH v3 04/10] fhandler_proc.cc(format_proc_cpuinfo): round cpu MHz

Brian Inglis Brian.Inglis@SystematicSW.ab.ca
Mon Oct 7 16:24:00 GMT 2019


round cpu MHz to correct Windows and match Linux cpuinfo

---
 winsup/cygwin/fhandler_proc.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc
index c94cde910..86c1f6253 100644
--- a/winsup/cygwin/fhandler_proc.cc
+++ b/winsup/cygwin/fhandler_proc.cc
@@ -695,6 +695,7 @@ format_proc_cpuinfo (void *, char *&destbuf)
 
       RtlQueryRegistryValues (RTL_REGISTRY_ABSOLUTE, cpu_key, tab,
 			      NULL, NULL);
+      cpu_mhz = ((cpu_mhz - 1) / 10 + 1) * 10;	/* round up to multiple of 10 */
       bufptr += __small_sprintf (bufptr, "processor\t: %d\n", cpu_number);
       uint32_t maxf, vendor_id[4], unused;
 
-- 
2.21.0



More information about the Cygwin-patches mailing list