2020-12-25 14:27:42 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-12-25 14:27:42 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <Kernel/Process.h>
|
|
|
|
|
#include <LibC/sys/prctl_numbers.h>
|
|
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
|
2021-06-28 15:59:35 -03:00
|
|
|
KResultOr<FlatPtr> Process::sys$prctl(int option, FlatPtr arg1, [[maybe_unused]] FlatPtr arg2)
|
2020-12-25 14:27:42 -03:00
|
|
|
{
|
2021-07-18 15:20:12 -03:00
|
|
|
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
|
2020-12-25 14:27:42 -03:00
|
|
|
switch (option) {
|
|
|
|
|
case PR_GET_DUMPABLE:
|
|
|
|
|
return is_dumpable();
|
|
|
|
|
case PR_SET_DUMPABLE:
|
|
|
|
|
set_dumpable(arg1);
|
|
|
|
|
return 0;
|
|
|
|
|
default:
|
2021-03-01 09:49:16 -03:00
|
|
|
return EINVAL;
|
2020-12-25 14:27:42 -03:00
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|