private static Errno ProcessFile(string path, OpenFlags flags, FdCb cb) { int fd = Syscall.open(path, flags); if (fd == -1) { return(Stdlib.GetLastError()); } int r = cb(fd); Errno res = 0; if (r == -1) { res = Stdlib.GetLastError(); } Syscall.close(fd); return(res); }
private static Errno ProcessFile(string path, OpenFlags flags, FdCb cb) { var fd = Syscall.open(path, (Mono.Unix.Native.OpenFlags)flags); if (fd == -1) { return(Stdlib.GetLastError()); } var r = cb(fd); Errno res = 0; if (r == -1) { res = Stdlib.GetLastError(); } _ = Syscall.close(fd); return(res); }
private static Errno ProcessFile(string path, FdCb cb) { return(Errno.Ok); }
private Errno ProcessFile(string path, OpenFlags flags, FdCb cb) { int fd = Syscall.open(path, flags); if (fd == -1) { return Stdlib.GetLastError(); } int r = cb(fd); Errno res = 0; if (r == -1) { res = Stdlib.GetLastError(); } Syscall.close(fd); return res; }
private static Errno ProcessFile (string path, FdCb cb) { return Errno.Ok; }