File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
20
20
([ #1817 ] ( https://github.com/nix-rust/nix/pull/1817 ) )
21
21
- Re-export ` RLIM_INFINITY ` from ` libc `
22
22
([ #1831 ] ( https://github.com/nix-rust/nix/pull/1831 ) )
23
+ - Added ` syncfs(2) ` on Linux
24
+ ([ #1833 ] ( https://github.com/nix-rust/nix/pull/1833 ) )
23
25
24
26
### Changed
25
27
Original file line number Diff line number Diff line change @@ -1354,6 +1354,17 @@ pub fn sync() {
1354
1354
unsafe { libc:: sync( ) } ;
1355
1355
}
1356
1356
1357
+ /// Commit filesystem caches containing file referred to by the open file
1358
+ /// descriptor `fd` to disk
1359
+ ///
1360
+ /// See also [syncfs(2)](https://man7.org/linux/man-pages/man2/sync.2.html)
1361
+ #[ cfg( target_os = "linux" ) ]
1362
+ pub fn syncfs( fd: RawFd ) -> Result <( ) > {
1363
+ let res = unsafe { libc:: syncfs( fd) } ;
1364
+
1365
+ Errno :: result( res) . map( drop)
1366
+ }
1367
+
1357
1368
/// Synchronize changes to a file
1358
1369
///
1359
1370
/// See also [fsync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html)
You can’t perform that action at this time.
0 commit comments