public static int open(string pathname, OpenFlags flags) { if ((flags & OpenFlags.O_CREAT) != OpenFlags.O_RDONLY) { throw new ArgumentException("If you pass O_CREAT, you must call the method with the mode flag"); } return(Syscall.syscall_open(pathname, Syscall.map_Mono_Posix_OpenFlags(flags), 0)); }
public static int open(string pathname, OpenFlags flags, FileMode mode) { int num = Syscall.map_Mono_Posix_OpenFlags(flags); return(Syscall.syscall_open(pathname, num, Syscall.map_Mono_Posix_FileMode(mode))); }