mirror of
https://github.com/RGBCube/serenity
synced 2025-10-16 00:32:24 +00:00

This matches out general macro use, and specifically other verification macros like VERIFY(), VERIFY_NOT_REACHED(), VERIFY_INTERRUPTS_ENABLED(), and VERIFY_INTERRUPTS_DISABLED().
21 lines
466 B
C++
21 lines
466 B
C++
/*
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <Kernel/Process.h>
|
|
|
|
namespace Kernel {
|
|
|
|
ErrorOr<FlatPtr> Process::sys$umask(mode_t mask)
|
|
{
|
|
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
|
|
TRY(require_promise(Pledge::stdio));
|
|
auto old_mask = m_protected_values.umask;
|
|
ProtectedDataMutationScope scope { *this };
|
|
m_protected_values.umask = mask & 0777;
|
|
return old_mask;
|
|
}
|
|
|
|
}
|