Author: jonpryor
Date: 2005-05-12 16:40:47 -0400 (Thu, 12 May 2005)
New Revision: 44466

Modified:
   trunk/mcs/class/Mono.Posix/Mono.Unix/ChangeLog
   trunk/mcs/class/Mono.Posix/Mono.Unix/Syscall.cs
   trunk/mcs/class/Mono.Posix/Mono.Unix/UnixConvert.cs
Log:
  * 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.


Modified: trunk/mcs/class/Mono.Posix/Mono.Unix/ChangeLog
===================================================================
--- trunk/mcs/class/Mono.Posix/Mono.Unix/ChangeLog      2005-05-12 20:35:07 UTC 
(rev 44465)
+++ trunk/mcs/class/Mono.Posix/Mono.Unix/ChangeLog      2005-05-12 20:40:47 UTC 
(rev 44466)
@@ -1,3 +1,10 @@
+2005-05-12  Jonathan Pryor <[EMAIL PROTECTED]>
+
+       * 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  <[EMAIL PROTECTED]>
 
        * UnixListener.cs (Init): Remove the call to Cleanup() and the

Modified: trunk/mcs/class/Mono.Posix/Mono.Unix/Syscall.cs
===================================================================
--- trunk/mcs/class/Mono.Posix/Mono.Unix/Syscall.cs     2005-05-12 20:35:07 UTC 
(rev 44465)
+++ trunk/mcs/class/Mono.Posix/Mono.Unix/Syscall.cs     2005-05-12 20:40:47 UTC 
(rev 44466)
@@ -620,6 +620,20 @@
                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
@@ -666,7 +680,7 @@
                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
        }
 

Modified: trunk/mcs/class/Mono.Posix/Mono.Unix/UnixConvert.cs
===================================================================
--- trunk/mcs/class/Mono.Posix/Mono.Unix/UnixConvert.cs 2005-05-12 20:35:07 UTC 
(rev 44465)
+++ trunk/mcs/class/Mono.Posix/Mono.Unix/UnixConvert.cs 2005-05-12 20:40:47 UTC 
(rev 44466)
@@ -695,6 +695,38 @@
                        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
                //

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to