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/).
2020 ([ #1817 ] ( https://github.com/nix-rust/nix/pull/1817 ) )
2121- Re-export ` RLIM_INFINITY ` from ` libc `
2222 ([ #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 ) )
2325
2426### Changed
2527
Original file line number Diff line number Diff line change @@ -1354,6 +1354,17 @@ pub fn sync() {
13541354 unsafe { libc:: sync( ) } ;
13551355}
13561356
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+
13571368/// Synchronize changes to a file
13581369///
13591370/// 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