5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-01-08 01:17:37 +03:00

Tools: add fsync sycall

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-01-30 17:17:14 +01:00 committed by Wolfgang Bumiller
parent bbdb1ae921
commit cee0e23ac0
2 changed files with 6 additions and 0 deletions

View 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,

View 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";