[6517] Properly initialize len argument of sysctl and include stdio.h ( perror)
Revision: 6517
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6517 Author: malc Date: 2009-02-04 20:39:09 +0000 (Wed, 04 Feb 2009)
Log Message:
-----------
Properly initialize len argument of sysctl and include stdio.h (perror)
Modified Paths:
--------------
trunk/cache-utils.c
Modified: trunk/cache-utils.c
===================================================================
cache-utils.c +2 -0
@@ -37,6 +37,7 @@ }#elif defined __APPLE__ +#include <stdio.h> #include <sys/types.h> #include <sys/sysctl.h>
@@ -46,6 +47,7 @@unsigned cacheline;int name[2 ] = {CTL_HW ,HW_CACHELINE }; + len =sizeof (cacheline);if (sysctl (name,2 , &cacheline, &len,NULL ,0 )) {perror ("sysctl CTL_HW HW_CACHELINE failed" ); }else {