2021-09-12 03:28:59 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2023-02-24 17:45:37 +00:00
|
|
|
#include <Kernel/Tasks/Process.h>
|
2021-09-12 03:28:59 +00:00
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
2021-11-07 23:51:39 +00:00
|
|
|
ErrorOr<FlatPtr> Process::sys$fsync(int fd)
|
2021-09-12 03:28:59 +00:00
|
|
|
{
|
2022-03-07 20:38:10 +00:00
|
|
|
VERIFY_NO_PROCESS_BIG_LOCK(this);
|
2021-12-29 09:11:45 +00:00
|
|
|
TRY(require_promise(Pledge::stdio));
|
2022-01-29 00:22:28 +00:00
|
|
|
auto description = TRY(open_file_description(fd));
|
2021-11-07 23:51:39 +00:00
|
|
|
TRY(description->sync());
|
|
|
|
return 0;
|
2021-09-12 03:28:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|