File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -50,13 +50,18 @@ libc_bitflags!(
50
50
51
51
libc_bitflags ! (
52
52
pub struct MntFlags : c_int {
53
+ /// Abort pending requests before attempting the unmount
53
54
MNT_FORCE ;
55
+ /// Perform a lazy unmount
54
56
MNT_DETACH ;
57
+ /// Mark the mount as expired
55
58
MNT_EXPIRE ;
59
+ /// Do not dereference unmount path target if it is a symbolic link
56
60
UMOUNT_NOFOLLOW ;
57
61
}
58
62
) ;
59
63
64
+ /// Mount a filesystem.
60
65
pub fn mount <
61
66
P1 : ?Sized + NixPath ,
62
67
P2 : ?Sized + NixPath ,
@@ -99,13 +104,15 @@ pub fn mount<
99
104
Errno :: result ( res) . map ( drop)
100
105
}
101
106
107
+ /// Unmount the filesystem mounted at `target`.
102
108
pub fn umount < P : ?Sized + NixPath > ( target : & P ) -> Result < ( ) > {
103
109
let res =
104
110
target. with_nix_path ( |cstr| unsafe { libc:: umount ( cstr. as_ptr ( ) ) } ) ?;
105
111
106
112
Errno :: result ( res) . map ( drop)
107
113
}
108
114
115
+ /// Unmount the filesystem mounted at `target`, using `flags` to control the behavior of the operation.
109
116
pub fn umount2 < P : ?Sized + NixPath > ( target : & P , flags : MntFlags ) -> Result < ( ) > {
110
117
let res = target. with_nix_path ( |cstr| unsafe {
111
118
libc:: umount2 ( cstr. as_ptr ( ) , flags. bits )
You can’t perform that action at this time.
0 commit comments