LibCore: Remove Process::spawn(StringView, ReadonlySpan<char const*>)

This commit is contained in:
stasoid 2024-11-16 15:15:56 +05:00 committed by Andrew Kaster
parent 33e7d6121b
commit 61d52c8a3f
Notes: github-actions[bot] 2024-11-19 22:28:48 +00:00
2 changed files with 0 additions and 23 deletions

View file

@ -158,26 +158,6 @@ ErrorOr<pid_t> Process::spawn(StringView path, ReadonlySpan<StringView> argument
return process.pid();
}
ErrorOr<pid_t> Process::spawn(StringView path, ReadonlySpan<char const*> arguments, ByteString working_directory, KeepAsChild keep_as_child)
{
Vector<ByteString> backing_strings;
backing_strings.ensure_capacity(arguments.size());
for (auto const& argument : arguments)
backing_strings.append(argument);
auto process = TRY(spawn({
.executable = path,
.arguments = backing_strings,
.working_directory = working_directory.is_empty() ? Optional<ByteString> {} : Optional<ByteString> { working_directory },
}));
if (keep_as_child == KeepAsChild::No)
TRY(process.disown());
else
process.m_should_disown = false;
return process.pid();
}
ErrorOr<String> Process::get_name()
{
#if defined(AK_OS_SERENITY)

View file

@ -78,9 +78,6 @@ public:
static ErrorOr<pid_t> spawn(StringView path, ReadonlySpan<ByteString> arguments, ByteString working_directory = {}, KeepAsChild keep_as_child = KeepAsChild::No);
static ErrorOr<pid_t> spawn(StringView path, ReadonlySpan<StringView> arguments, ByteString working_directory = {}, KeepAsChild keep_as_child = KeepAsChild::No);
// FIXME: Remove this. char const* should not exist on this level of abstraction.
static ErrorOr<pid_t> spawn(StringView path, ReadonlySpan<char const*> arguments = {}, ByteString working_directory = {}, KeepAsChild keep_as_child = KeepAsChild::No);
static ErrorOr<String> get_name();
enum class SetThreadName {
No,