mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 19:57:45 +03:00
LibCore: Implement Process::get_name for linux and macos
This commit is contained in:
parent
1b5b1e4153
commit
002e206af0
Notes:
sideshowbarker
2024-07-16 21:51:02 +09:00
Author: https://github.com/SebastianZaha Commit: https://github.com/SerenityOS/serenity/commit/002e206af0 Pull-request: https://github.com/SerenityOS/serenity/pull/20327 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/AtkinsSJ
@ -114,6 +114,11 @@ ErrorOr<String> Process::get_name()
|
||||
if (rc != 0)
|
||||
return Error::from_syscall("get_process_name"sv, -rc);
|
||||
return String::from_utf8(StringView { buffer, strlen(buffer) });
|
||||
#elif defined(AK_OS_LINUX)
|
||||
return String::from_utf8(StringView { program_invocation_name, strlen(program_invocation_name) });
|
||||
#elif defined(AK_OS_BSD_GENERIC)
|
||||
auto const* progname = getprogname();
|
||||
return String::from_utf8(StringView { progname, strlen(progname) });
|
||||
#else
|
||||
// FIXME: Implement Process::get_name() for other platforms.
|
||||
return "???"_short_string;
|
||||
|
Loading…
Reference in New Issue
Block a user