Commit
[mono.git] / support / sys-mount.c
1 /*
2  * <sys/mount.h> wrapper functions.
3  *
4  * Authors:
5  *   Jonathan Pryor (jonpryor@vt.edu)
6  *
7  * Copyright (C) 2004 Jonathan Pryor
8  */
9
10 #include <sys/mount.h>
11 #include <glib/gtypes.h>
12
13 #include "mph.h"
14 #include "map.h"
15
16 G_BEGIN_DECLS
17
18 gint32
19 Mono_Posix_Syscall_mount (const char *source, const char *target, 
20                 const char *filesystemtype, guint64 mountflags, void *data)
21 {
22         if (Mono_Posix_FromMountFlags (mountflags, &mountflags) == -1)
23                 return -1;
24
25 #ifdef MPH_ON_BSD
26         return mount (filesystemtype, target, mountflags, data);
27 #else
28         return mount (source, target, filesystemtype, (unsigned long) mountflags, data);
29 #endif
30 }
31
32 gint32
33 Mono_Posix_Syscall_umount (const char *source)
34 {
35 #ifdef MPH_ON_BSD
36         return unmount (source, MNT_FORCE);
37 #else
38         return umount (source);
39 #endif
40 }
41
42 gint32
43 Mono_Posix_Syscall_umount2 (const char *source, gint32 flags)
44 {
45 #ifdef MPH_ON_BSD
46         return unmount (source, flags);
47 #else
48         return umount2 (source, flags);
49 #endif
50 }
51
52 G_END_DECLS
53
54 /*
55  * vim: noexpandtab
56  */