+2005-05-12 Jonathan Pryor <jonpryor@vt.edu>
+
+ * Syscall.cs: The Statvfs structure should contain a MountFlags enumeration,
+ not a ulong (we can "safely" do this since POSIX defines some values for
+ f_flag, so we should be kind and expose them).
+ * UnixConvert.cs: Add MountFlags conversion functions.
+
2005-05-02 Joe Shaw <joeshaw@novell.com>
* UnixListener.cs (Init): Remove the call to Cleanup() and the
XATTR_REPLACE = 2,
}
+ [Map][Flags]
+ public enum MountFlags : ulong {
+ ST_RDONLY = 1, // Mount read-only
+ ST_NOSUID = 2, // Ignore suid and sgid bits
+ ST_NODEV = 4, // Disallow access to device special files
+ ST_SYNCHRONOUS = 16, // Writes are synced at once
+ ST_MANDLOCK = 64, // Allow mandatory locks on an FS
+ ST_WRITE = 128, // Write on file/directory/symlink
+ ST_APPEND = 256, // Append-only file
+ ST_IMMUTABLE = 512, // Immutable file
+ ST_NOATIME = 1024, // Do not update access times
+ ST_NODIRATIME = 2048, // Do not update directory access times
+ }
+
#endregion
#region Structures
public /* fsfilcnt_t */ ulong f_ffree; // # free inodes
public /* fsfilcnt_t */ ulong f_favail; // # free inodes for non-root
public ulong f_fsid; // file system id
- public ulong f_flag; // mount flags
+ public MountFlags f_flag; // mount flags
public ulong f_namemax; // maximum filename length
}
return rval;
}
+ [DllImport (LIB, EntryPoint="Mono_Posix_FromMountFlags")]
+ private static extern int FromMountFlags (MountFlags value, out UInt64 rval);
+
+ public static bool TryFromMountFlags (MountFlags value, out UInt64 rval)
+ {
+ return FromMountFlags (value, out rval) == 0;
+ }
+
+ public static UInt64 FromMountFlags (MountFlags value)
+ {
+ UInt64 rval;
+ if (FromMountFlags (value, out rval) == -1)
+ ThrowArgumentException (value);
+ return rval;
+ }
+
+ [DllImport (LIB, EntryPoint="Mono_Posix_ToMountFlags")]
+ private static extern int ToMountFlags (UInt64 value, out MountFlags rval);
+
+ public static bool TryToMountFlags (UInt64 value, out MountFlags rval)
+ {
+ return ToMountFlags (value, out rval) == 0;
+ }
+
+ public static MountFlags ToMountFlags (UInt64 value)
+ {
+ MountFlags rval;
+ if (ToMountFlags (value, out rval) == -1)
+ ThrowArgumentException (value);
+ return rval;
+ }
+
//
// Non-generated exports
//