add FormatSize binding

This commit is contained in:
Doug MacEachern 2004-09-17 22:40:47 +00:00
parent 1b50ea38e2
commit ff4e25b6a2
1 changed files with 10 additions and 0 deletions

View File

@ -39,6 +39,16 @@ namespace Hyperic.Sigar {
this.sigar = new HandleRef(this, handle); this.sigar = new HandleRef(this, handle);
} }
[DllImport(Sigar.LIBSIGAR)]
private static extern string
sigar_format_size(ulong size, StringBuilder buffer);
public static string FormatSize(ulong size) {
StringBuilder buffer = new StringBuilder();
buffer.Capacity = 56;
return sigar_format_size(size, buffer);
}
public Mem Mem() { public Mem Mem() {
return Hyperic.Sigar.Mem.NativeGet(this); return Hyperic.Sigar.Mem.NativeGet(this);
} }