Ejemplo n.º 1
0
 private static void CopyUtsname(ref Utsname to, ref _Utsname from)
 {
     try
     {
         to = new Utsname
         {
             sysname    = Marshal.PtrToStringAnsi(from.sysname),
             nodename   = Marshal.PtrToStringAnsi(from.nodename),
             release    = Marshal.PtrToStringAnsi(from.release),
             version    = Marshal.PtrToStringAnsi(from.version),
             machine    = Marshal.PtrToStringAnsi(from.machine),
             domainname = Marshal.PtrToStringAnsi(from.domainname)
         };
     }
     finally
     {
         free(from._buf_);
         from._buf_ = IntPtr.Zero;
     }
 }
Ejemplo n.º 2
0
 private static extern int sys_uname(out _Utsname buf);