]> git.proxmox.com Git - pve-common.git/commitdiff
Tools: add fsync sycall
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 30 Jan 2019 16:17:14 +0000 (17:17 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 31 Jan 2019 10:42:17 +0000 (11:42 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Syscall.pm
src/PVE/Tools.pm

index 87db66a3e61a601d543ccaaae10cd07047ec9b0d..0f50c631b85d1e05b2cea9f5fd7dd923c75659a8 100644 (file)
@@ -8,6 +8,7 @@ BEGIN {
        unshare => &SYS_unshare,
        setns => &SYS_setns,
        syncfs => &SYS_syncfs,
+       fsync => &SYS_fsync,
        openat => &SYS_openat,
        close => &SYS_close,
        mkdirat => &SYS_mkdirat,
index accf6539da94d2b5d5b6f4539310fe5c4d526c7e..cd236b5d6249f7aabd988bbddfb6ac9d8cc66c0e 100644 (file)
@@ -1399,6 +1399,11 @@ sub syncfs($) {
     return 0 == syscall(PVE::Syscall::syncfs, $fileno);
 }
 
+sub fsync($) {
+    my ($fileno) = @_;
+    return 0 == syscall(PVE::Syscall::fsync, $fileno);
+}
+
 sub sync_mountpoint {
     my ($path) = @_;
     sysopen my $fd, $path, O_PATH or die "failed to open $path: $!\n";