mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
Kernel: Create /proc/pid/cmdline to expose process arguments in procfs
In typical serenity style, they are just a JSON array
This commit is contained in:
committed by
Andreas Kling
parent
ad0a001f0a
commit
940be19259
@@ -314,6 +314,16 @@ ErrorOr<void> Process::procfs_get_current_work_directory_link(KBufferBuilder& bu
|
||||
return builder.append(TRY(const_cast<Process&>(*this).current_directory()->try_serialize_absolute_path())->view());
|
||||
}
|
||||
|
||||
ErrorOr<void> Process::procfs_get_command_line(KBufferBuilder& builder) const
|
||||
{
|
||||
auto array = TRY(JsonArraySerializer<>::try_create(builder));
|
||||
for (auto const& arg : arguments()) {
|
||||
TRY(array.add(arg.view()));
|
||||
}
|
||||
TRY(array.finish());
|
||||
return {};
|
||||
}
|
||||
|
||||
mode_t Process::binary_link_required_mode() const
|
||||
{
|
||||
if (!executable())
|
||||
|
||||
Reference in New Issue
Block a user