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
Fix issue 21113: Use sysctl for thisExePath on BSD. #7578
Fix issue 21113: Use sysctl for thisExePath on BSD. #7578
Conversation
Thanks for your pull request and interest in making D better, @euantorano! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#7578" |
49556f8
to
4ae8c60
Compare
4ae8c60
to
c518538
Compare
No, the way you have done it is the intended way. Forcing giving a name to the version gives documentation and forces you to think about the versioning logic, i.e. not making arbitrary combinations. |
Ah, ok. That makes sense, thanks! |
The linked netBSD has |
version (NetBSD)
{
enum
{
KERN_PROC_ARGS = 48,
KERN_PROC_PATHNAME = 5
}
int[4] mib = [CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME];
} I think you might be misreading the |
Oh right, I stand corrected. |
Fixes issue 21113.
I'm quite new to D, and wasn't sure if there's a way to do a condition inside a version, like the following:
Which would make some of this code slightly cleaner in my opinion.
Sysctl numbers are taken from relevant headers: