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