ladybird/Kernel/Syscalls/sync.cpp
Idan Horowitz 9d21c79671 Kernel: Disable big process lock for sys$sync
This syscall doesn't touch any intra-process shared resources and only
calls VirtualFileSystem::sync, which is self-locking.
2021-08-07 15:30:26 +02:00

21 lines
371 B
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/FileSystem/VirtualFileSystem.h>
#include <Kernel/Process.h>
namespace Kernel {
KResultOr<FlatPtr> Process::sys$sync()
{
VERIFY_NO_PROCESS_BIG_LOCK(this)
REQUIRE_PROMISE(stdio);
VirtualFileSystem::sync();
return 0;
}
}