Skip to content

Use _NSGetExecutablePath() instead of proc_pidpath() to get the main executable path. #374

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

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Apr 25, 2024

This PR switches to _NSGetExecutablePath() when getting the path to the current process. _NSGetExecutablePath() pulls from the current process' address space, while proc_pidpath() involves a syscall and potential sandbox checks.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

…ain executable path.

This PR switches to `_NSGetExecutablePath()` when getting the path to the
current process.
@grynspan grynspan added bug 🪲 Something isn't working darwin 🍎 macOS, iOS, watchOS, tvOS, and visionOS support performance 🏎️ Performance issues labels Apr 25, 2024
@grynspan grynspan self-assigned this Apr 25, 2024
@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan
Copy link
Contributor Author

Verified the change at desk: the failures are due to known CI issues.

@grynspan grynspan merged commit f954b76 into main Apr 25, 2024
@grynspan grynspan deleted the jgrynspan/use-_NSGetExecutablePath branch April 25, 2024 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working darwin 🍎 macOS, iOS, watchOS, tvOS, and visionOS support performance 🏎️ Performance issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants