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