Skip to content

Fallback to argv[0] for ProcessInfo.processName on platforms without specific APIs. #1447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kateinoigakukun
Copy link
Member

WASI does not provide a specific API to retrieve the process name, so we used CommandLine.arguments.first for ProcessInfo.processName. After #1411, CommandLine.arguments.first started using platform-specific APIs to retrieve the process name, but the fallback path with argv[0] was removed. This commit restores that fallback for platforms like WASI.

…out specific APIs.

WASI does not provide a specific API to retrieve the process name,
so we used `CommandLine.arguments.first` for `ProcessInfo.processName`.
After swiftlang#1411, `CommandLine.arguments.first` started using platform-specific
APIs to retrieve the process name, but the fallback path with `argv[0]`
was removed. This commit restores that fallback for platforms like WASI.
@kateinoigakukun
Copy link
Member Author

@swift-ci test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant