mv sigar_sys_info_get outside #ifndef WIN32

This commit is contained in:
Doug MacEachern 2006-09-25 00:08:50 +00:00
parent 84b8fff7b1
commit 8b2ca20810
1 changed files with 32 additions and 34 deletions

View File

@ -244,7 +244,39 @@ SIGAR_DECLARE(char *) sigar_format_size(sigar_uint64_t size, char *buf)
} while (1);
}
SIGAR_DECLARE(int) sigar_sys_info_get(sigar_t *sigar,
sigar_sys_info_t *sysinfo)
{
SIGAR_ZERO(sysinfo);
#ifndef WIN32
sigar_sys_info_get_uname(sysinfo);
#endif
sigar_os_sys_info_get(sigar, sysinfo);
return SIGAR_OK;
}
#ifndef WIN32
#include <sys/utsname.h>
int sigar_sys_info_get_uname(sigar_sys_info_t *sysinfo)
{
struct utsname name;
uname(&name);
SIGAR_SSTRCPY(sysinfo->version, name.release);
SIGAR_SSTRCPY(sysinfo->vendor_name, name.sysname);
SIGAR_SSTRCPY(sysinfo->name, name.sysname);
SIGAR_SSTRCPY(sysinfo->arch, name.machine);
SIGAR_SSTRCPY(sysinfo->patch_level, "unknown");
return SIGAR_OK;
}
#include <pwd.h>
#include <grp.h>
@ -1211,40 +1243,6 @@ int sigar_net_info_get(sigar_t *sigar,
return SIGAR_OK;
}
#ifndef WIN32
#include <sys/utsname.h>
int sigar_sys_info_get_uname(sigar_sys_info_t *sysinfo)
{
struct utsname name;
uname(&name);
SIGAR_SSTRCPY(sysinfo->version, name.release);
SIGAR_SSTRCPY(sysinfo->vendor_name, name.sysname);
SIGAR_SSTRCPY(sysinfo->name, name.sysname);
SIGAR_SSTRCPY(sysinfo->arch, name.machine);
SIGAR_SSTRCPY(sysinfo->patch_level, "unknown");
return SIGAR_OK;
}
#endif
SIGAR_DECLARE(int) sigar_sys_info_get(sigar_t *sigar,
sigar_sys_info_t *sysinfo)
{
SIGAR_ZERO(sysinfo);
#ifndef WIN32
sigar_sys_info_get_uname(sysinfo);
#endif
sigar_os_sys_info_get(sigar, sysinfo);
return SIGAR_OK;
}
#include <sys/resource.h>
#define OffsetOf(structure, field) \