Permalink
Browse files

Add various methods and flags to Syscall

    * Add OpenFlags.O_CLOEXEC and OpenFlags.O_PATH

    * Add AtFlags for AT_* values

    * Add fdopendir, mkdtemp, futimens

    * Add readv, writev, preadv, pwritev

    * Add *at methods: openat, renameat, fchmodat, fstatat, utimensat,
      mkdirat, mknodat, mkfifoat, faccessat, fchownat, linkat, readlinkat,
      symlinkat, unlinkat

    * Add constants AT_FDCWD, UTIME_NOW, UTIME_OMIT
  • Loading branch information...
1 parent 6ceccd8 commit 5329fab38b640727b78a6e09b53900801bf47347 @steffen-kiess steffen-kiess committed Mar 26, 2013
View
@@ -1959,6 +1959,9 @@ if test x$target_win32 = xno; then
AC_CHECK_FUNCS(lockf)
AC_CHECK_FUNCS(swab)
AC_CHECK_FUNCS(setusershell endusershell)
+ AC_CHECK_FUNCS(futimens utimensat)
+ AC_CHECK_FUNCS(fstatat mknodat readlinkat)
+ AC_CHECK_FUNCS(readv writev preadv pwritev)
AC_CHECK_SIZEOF(size_t)
AC_CHECK_TYPES([blksize_t], [AC_DEFINE(HAVE_BLKSIZE_T)], ,
[#include <sys/types.h>
@@ -1973,6 +1976,8 @@ if test x$target_win32 = xno; then
AC_CHECK_TYPES([struct flock], [AC_DEFINE(HAVE_STRUCT_FLOCK)], ,
[#include <unistd.h>
#include <fcntl.h>])
+ AC_CHECK_TYPES([struct iovec], [AC_DEFINE(HAVE_STRUCT_IOVEC)], ,
+ [#include <sys/uio.h>])
AC_CHECK_TYPES([struct pollfd], [AC_DEFINE(HAVE_STRUCT_POLLFD)], ,
[#include <sys/poll.h>])
AC_CHECK_TYPES([struct stat], [AC_DEFINE(HAVE_STRUCT_STAT)], ,
@@ -54,6 +54,38 @@ public static AccessModes ToAccessModes (Int32 value)
return rval;
}
+ [DllImport (LIB, EntryPoint="Mono_Posix_FromAtFlags")]
+ private static extern int FromAtFlags (AtFlags value, out Int32 rval);
+
+ public static bool TryFromAtFlags (AtFlags value, out Int32 rval)
+ {
+ return FromAtFlags (value, out rval) == 0;
+ }
+
+ public static Int32 FromAtFlags (AtFlags value)
+ {
+ Int32 rval;
+ if (FromAtFlags (value, out rval) == -1)
+ ThrowArgumentException (value);
+ return rval;
+ }
+
+ [DllImport (LIB, EntryPoint="Mono_Posix_ToAtFlags")]
+ private static extern int ToAtFlags (Int32 value, out AtFlags rval);
+
+ public static bool TryToAtFlags (Int32 value, out AtFlags rval)
+ {
+ return ToAtFlags (value, out rval) == 0;
+ }
+
+ public static AtFlags ToAtFlags (Int32 value)
+ {
+ AtFlags rval;
+ if (ToAtFlags (value, out rval) == -1)
+ ThrowArgumentException (value);
+ return rval;
+ }
+
[DllImport (LIB, EntryPoint="Mono_Posix_FromConfstrName")]
private static extern int FromConfstrName (ConfstrName value, out Int32 rval);
@@ -294,6 +326,22 @@ public static bool TryCopy (IntPtr source, out Flock destination)
return ToFlock (source, out destination) == 0;
}
+ [DllImport (LIB, EntryPoint="Mono_Posix_FromIovec")]
+ private static extern int FromIovec (ref Iovec source, IntPtr destination);
+
+ public static bool TryCopy (ref Iovec source, IntPtr destination)
+ {
+ return FromIovec (ref source, destination) == 0;
+ }
+
+ [DllImport (LIB, EntryPoint="Mono_Posix_ToIovec")]
+ private static extern int ToIovec (IntPtr source, out Iovec destination);
+
+ public static bool TryCopy (IntPtr source, out Iovec destination)
+ {
+ return ToIovec (source, out destination) == 0;
+ }
+
[DllImport (LIB, EntryPoint="Mono_Posix_FromLockType")]
private static extern int FromLockType (LockType value, out Int16 rval);
Oops, something went wrong.

0 comments on commit 5329fab

Please sign in to comment.