2020-07-30 17:38:15 -04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 04:24:48 -04:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-07-30 17:38:15 -04:00
|
|
|
*/
|
|
|
|
|
2020-12-30 09:19:57 -05:00
|
|
|
#include <AK/Types.h>
|
2023-02-24 12:45:37 -05:00
|
|
|
#include <Kernel/Tasks/Process.h>
|
2020-07-30 17:38:15 -04:00
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
2021-11-07 18:51:39 -05:00
|
|
|
ErrorOr<FlatPtr> Process::sys$getpid()
|
2020-07-30 17:38:15 -04:00
|
|
|
{
|
2022-08-17 16:03:04 -04:00
|
|
|
VERIFY_NO_PROCESS_BIG_LOCK(this);
|
2021-12-29 04:11:45 -05:00
|
|
|
TRY(require_promise(Pledge::stdio));
|
2021-03-10 13:59:46 -05:00
|
|
|
return pid().value();
|
2020-07-30 17:38:15 -04:00
|
|
|
}
|
|
|
|
|
2021-11-07 18:51:39 -05:00
|
|
|
ErrorOr<FlatPtr> Process::sys$getppid()
|
2020-07-30 17:38:15 -04:00
|
|
|
{
|
2022-08-21 07:29:36 -04:00
|
|
|
VERIFY_NO_PROCESS_BIG_LOCK(this);
|
2021-12-29 04:11:45 -05:00
|
|
|
TRY(require_promise(Pledge::stdio));
|
2022-08-21 07:29:36 -04:00
|
|
|
return ppid().value();
|
2020-07-30 17:38:15 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|