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