add SigarException class

This commit is contained in:
Doug MacEachern 2004-09-17 23:33:57 +00:00
parent 5e3e4af2f7
commit f2ced368e1
1 changed files with 20 additions and 0 deletions

View File

@ -96,6 +96,26 @@ namespace Hyperic.Sigar {
} }
} }
public class SigarException : Exception {
Sigar sigar;
int errno;
public SigarException(Sigar sigar, int errno) : base () {
this.sigar = sigar;
this.errno = errno;
}
[DllImport(Sigar.LIBSIGAR)]
private static extern string
sigar_strerror(IntPtr sigar, int errno);
public override string Message {
get {
return sigar_strerror(this.sigar.sigar.Handle, this.errno);
}
}
}
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Mem { public struct Mem {
public readonly ulong Ram; public readonly ulong Ram;