From 005fea17c272e748e4e4752ff95967f15e2a5314 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 9 Dec 2005 21:10:56 +0000 Subject: [PATCH] avoid memcpy of kstat_io_t in kstat_read --- src/os/solaris/solaris_sigar.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/os/solaris/solaris_sigar.c b/src/os/solaris/solaris_sigar.c index c14732ec..3bee3ecd 100644 --- a/src/os/solaris/solaris_sigar.c +++ b/src/os/solaris/solaris_sigar.c @@ -1358,13 +1358,17 @@ static int fs_kstat_read(sigar_t *sigar, sigar_file_system_usage_t *fsusage, kstat_t *ksp) { - kstat_io_t io; - kstat_read(sigar->kc, ksp, &io); - fsusage->disk_reads = io.reads; - fsusage->disk_writes = io.writes; - fsusage->disk_read_bytes = io.nread; - fsusage->disk_write_bytes = io.nwritten; - fsusage->disk_queue = io.wcnt; /* XXX ? */ + kstat_io_t *io; + + kstat_read(sigar->kc, ksp, NULL); + + io = (kstat_io_t *)ksp->ks_data; + + fsusage->disk_reads = io->reads; + fsusage->disk_writes = io->writes; + fsusage->disk_read_bytes = io->nread; + fsusage->disk_write_bytes = io->nwritten; + fsusage->disk_queue = io->wcnt; /* XXX ? */ return SIGAR_OK; }