2020-12-25 20:27:42 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-12-25 20:27:42 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <Kernel/Process.h>
|
|
|
|
#include <LibC/sys/prctl_numbers.h>
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
2021-11-08 02:51:39 +03:00
|
|
|
ErrorOr<FlatPtr> Process::sys$prctl(int option, FlatPtr arg1, [[maybe_unused]] FlatPtr arg2)
|
2020-12-25 20:27:42 +03:00
|
|
|
{
|
2021-07-18 21:20:12 +03:00
|
|
|
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
|
2020-12-25 20:27:42 +03:00
|
|
|
switch (option) {
|
|
|
|
case PR_GET_DUMPABLE:
|
|
|
|
return is_dumpable();
|
|
|
|
case PR_SET_DUMPABLE:
|
|
|
|
set_dumpable(arg1);
|
|
|
|
return 0;
|
|
|
|
}
|
2021-10-07 20:51:24 +03:00
|
|
|
return EINVAL;
|
2020-12-25 20:27:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|