mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
Kernel+LibC: Implement fsync
This commit is contained in:
parent
fd3735199b
commit
a81b21c1a7
13 changed files with 51 additions and 6 deletions
19
Kernel/Syscalls/fsync.cpp
Normal file
19
Kernel/Syscalls/fsync.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Copyright (c) 2021, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <Kernel/Process.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
KResultOr<FlatPtr> Process::sys$fsync(int fd)
|
||||
{
|
||||
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
|
||||
REQUIRE_PROMISE(stdio);
|
||||
auto description = TRY(fds().open_file_description(fd));
|
||||
return description->sync();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue