summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/fsync.cpp
blob: 3e1445de77755effd4bde2e45d23d2f01b82528b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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();
}

}