use sigar_open instead of sigar_new wrapper

This commit is contained in:
Doug MacEachern committed 2004-09-20 22:10:01 +00:00
1 parent a301251699
commit bcd94bb327
2 files changed
+6 -2

No files matched your search

+5 -2
View File
@@ -31,13 +31,16 @@ namespace Hyperic.Sigar {
internal HandleRef sigar;
[DllImport(LIBSIGAR)]
private static extern IntPtr sigar_new();
unsafe private static extern int sigar_open(IntPtr *sigar);
[DllImport(LIBSIGAR)]
private static extern int sigar_close(IntPtr sigar);
public Sigar() {
IntPtr handle = sigar_new();
IntPtr handle;
unsafe { //&pointers are considered "unsafe"
sigar_open(&handle);
}
this.sigar = new HandleRef(this, handle);
}