ladybird/Kernel/Syscalls/fsync.cpp

21 lines
392 B
C++
Raw Normal View History

2021-09-12 03:28:59 +00:00
/*
* Copyright (c) 2021, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/Process.h>
namespace Kernel {
ErrorOr<FlatPtr> Process::sys$fsync(int fd)
2021-09-12 03:28:59 +00:00
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
TRY(require_promise(Pledge::stdio));
2021-09-12 03:28:59 +00:00
auto description = TRY(fds().open_file_description(fd));
TRY(description->sync());
return 0;
2021-09-12 03:28:59 +00:00
}
}