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