2021-08-06 01:04:11 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
2022-05-10 00:24:15 +01:00
|
|
|
* Copyright (c) 2022, MacDue <macdue@dueutil.tech>
|
2023-01-22 19:55:20 +00:00
|
|
|
* Copyright (c) 2023, Sam Atkins <atkinssj@serenityos.org>
|
2021-08-06 01:04:11 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/Forward.h>
|
2022-05-10 00:24:15 +01:00
|
|
|
#include <AK/Span.h>
|
2021-08-06 01:04:11 +02:00
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
|
|
|
|
class Process {
|
|
|
|
public:
|
2023-03-15 16:49:13 +00:00
|
|
|
enum class KeepAsChild {
|
|
|
|
Yes,
|
|
|
|
No
|
|
|
|
};
|
|
|
|
|
|
|
|
static ErrorOr<pid_t> spawn(StringView path, ReadonlySpan<DeprecatedString> arguments, DeprecatedString working_directory = {}, KeepAsChild keep_as_child = KeepAsChild::No);
|
|
|
|
static ErrorOr<pid_t> spawn(StringView path, ReadonlySpan<StringView> arguments, DeprecatedString working_directory = {}, KeepAsChild keep_as_child = KeepAsChild::No);
|
|
|
|
static ErrorOr<pid_t> spawn(StringView path, ReadonlySpan<char const*> arguments = {}, DeprecatedString working_directory = {}, KeepAsChild keep_as_child = KeepAsChild::No);
|
2023-01-22 19:55:20 +00:00
|
|
|
|
|
|
|
static ErrorOr<String> get_name();
|
|
|
|
enum class SetThreadName {
|
|
|
|
No,
|
|
|
|
Yes,
|
|
|
|
};
|
|
|
|
static ErrorOr<void> set_name(StringView, SetThreadName = SetThreadName::No);
|
2023-08-02 10:27:58 +02:00
|
|
|
|
2023-08-02 14:09:19 +02:00
|
|
|
static void wait_for_debugger_and_break();
|
2023-08-02 10:27:58 +02:00
|
|
|
static ErrorOr<bool> is_being_debugged();
|
2021-08-06 01:04:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|