fix solaris compile

This commit is contained in:
Doug MacEachern 2008-04-11 05:13:18 +00:00
parent b1d8e39106
commit dd9575370a
1 changed files with 4 additions and 2 deletions

View File

@ -490,7 +490,7 @@ typedef struct {
sigar_uint32_t edx; sigar_uint32_t edx;
} sigar_cpuid_t; } sigar_cpuid_t;
#if defined(__GNUC__) #if defined(__GNUC__) && !defined(__sun)
# if defined(__i386__) # if defined(__i386__)
# define SIGAR_HAS_CPUID # define SIGAR_HAS_CPUID
@ -558,7 +558,7 @@ static void sigar_cpuid(sigar_uint32_t request,
int sigar_cpu_core_count(sigar_t *sigar) int sigar_cpu_core_count(sigar_t *sigar)
{ {
#ifdef SIGAR_HAS_CPUID #if defined(SIGAR_HAS_CPUID)
sigar_cpuid_t id; sigar_cpuid_t id;
if (sigar->lcpu == -1) { if (sigar->lcpu == -1) {
@ -579,6 +579,8 @@ int sigar_cpu_core_count(sigar_t *sigar)
} }
return sigar->lcpu; return sigar->lcpu;
#elif defined(__sun)
return 1;
#else #else
sigar->lcpu = 1; sigar->lcpu = 1;
return sigar->lcpu; return sigar->lcpu;