Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'support/sys-mount.c')
-rw-r--r--support/sys-mount.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/support/sys-mount.c b/support/sys-mount.c
new file mode 100644
index 00000000000..b13933c7f71
--- /dev/null
+++ b/support/sys-mount.c
@@ -0,0 +1,56 @@
+/*
+ * <sys/mount.h> wrapper functions.
+ *
+ * Authors:
+ * Jonathan Pryor (jonpryor@vt.edu)
+ *
+ * Copyright (C) 2004 Jonathan Pryor
+ */
+
+#include <sys/mount.h>
+#include <glib/gtypes.h>
+
+#include "mph.h"
+#include "map.h"
+
+G_BEGIN_DECLS
+
+gint32
+Mono_Posix_Syscall_mount (const char *source, const char *target,
+ const char *filesystemtype, guint64 mountflags, void *data)
+{
+ if (Mono_Posix_FromMountFlags (mountflags, &mountflags) == -1)
+ return -1;
+
+#ifdef MPH_ON_BSD
+ return mount (filesystemtype, target, mountflags, data);
+#else
+ return mount (source, target, filesystemtype, (unsigned long) mountflags, data);
+#endif
+}
+
+gint32
+Mono_Posix_Syscall_umount (const char *source)
+{
+#ifdef MPH_ON_BSD
+ return unmount (source, MNT_FORCE);
+#else
+ return umount (source);
+#endif
+}
+
+gint32
+Mono_Posix_Syscall_umount2 (const char *source, gint32 flags)
+{
+#ifdef MPH_ON_BSD
+ return unmount (source, flags);
+#else
+ return umount2 (source, flags);
+#endif
+}
+
+G_END_DECLS
+
+/*
+ * vim: noexpandtab
+ */