2 // Mono.Posix.Syscall.cs: System calls to Posix subsystem features
6 using System.Runtime.InteropServices;
10 public unsafe class Syscall {
11 [DllImport ("libc", EntryPoint="gethostname")]
12 static unsafe extern int syscall_gethostname (byte *p, int len);
14 public static string GetHostName ()
16 byte [] buf = new byte [256];
18 fixed (byte *p = &buf [0]){
22 return new String(Encoding.UTF8.GetChars (buf));