File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
6
6
## [ Unreleased]
7
7
8
8
### Added
9
+ - Added a ` sync ` wrapper.
10
+ ([ #961 ] ( https://github.com/nix-rust/nix/pull/961 ) )
9
11
- Added a ` sysinfo ` wrapper.
10
12
([ #922 ] ( https://github.com/nix-rust/nix/pull/922 ) )
11
13
- Support the ` SO_PEERCRED ` socket option and the ` UnixCredentials ` type on all Linux and Android targets.
Original file line number Diff line number Diff line change @@ -1101,6 +1101,20 @@ pub fn chroot<P: ?Sized + NixPath>(path: &P) -> Result<()> {
1101
1101
Errno :: result ( res) . map ( drop)
1102
1102
}
1103
1103
1104
+ /// Commit filesystem caches to disk
1105
+ ///
1106
+ /// See also [sync(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/sync.html)
1107
+ #[ cfg( any(
1108
+ target_os = "dragonfly" ,
1109
+ target_os = "freebsd" ,
1110
+ target_os = "linux" ,
1111
+ target_os = "netbsd" ,
1112
+ target_os = "openbsd"
1113
+ ) ) ]
1114
+ pub fn sync ( ) -> ( ) {
1115
+ unsafe { libc:: sync ( ) } ;
1116
+ }
1117
+
1104
1118
/// Synchronize changes to a file
1105
1119
///
1106
1120
/// See also [fsync(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html)
You can’t perform that action at this time.
0 commit comments