Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static TimeVal GetBoottime()
- {
- var pLen = Marshal.AllocHGlobal(sizeof(int));
- sysctlbyname("kern.boottime", IntPtr.Zero, pLen, IntPtr.Zero, 0);
- var length = Marshal.ReadInt32(pLen);
- var pStr = Marshal.AllocHGlobal(length);
- sysctlbyname("kern.boottime", pStr, pLen, IntPtr.Zero, 0);
- return Marshal.PtrToStructure<TimeVal>(pStr);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement