-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Define _CS_PATH on the BSDs #4738
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
Conversation
Some changes occurred in OpenBSD module cc @semarie |
b78588a
to
1d1226b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- LGTM for OpenBSD part
- but you added
_CS_PATH
in netbsd.txt and I don't see corresponding mod.rs edited
According to https://man.netbsd.org/confstr.3 _CS_PATH is obsoleted by sysctl (which has a USER_CS_PATH equivalent), but Linux doesn't have that. So the simplest thing for applications is to use _CS_PATH which is part of POSIX. Define, matching the <unistd.h> header. We could maybe share this definition in src/unix/bsd/netbsdlike/mod.rs, but I saw that existing definitions are not shared either, so I'm not sure. $ grep src/unix/bsd/netbsdlike -e _PC_LINK_MAX src/unix/bsd/netbsdlike/netbsd/mod.rs:1599:11:pub const _PC_LINK_MAX: c_int = 1; src/unix/bsd/netbsdlike/openbsd/mod.rs:1193:11:pub const _PC_LINK_MAX: c_int = 1; Originally reported in fish-shell/fish-shell#11892
1d1226b
to
cdd6bb0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks.
Please note that currently people able to merge seems to be busy. it could take some time to be merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
According to https://man.netbsd.org/confstr.3 _CS_PATH is obsoleted by sysctl (which has a USER_CS_PATH equivalent), but Linux doesn't have that. So the simplest thing for applications is to use _CS_PATH which is part of POSIX. Define, matching the <unistd.h> header. We could maybe share this definition in src/unix/bsd/netbsdlike/mod.rs, but I saw that existing definitions are not shared either, so I'm not sure. $ grep src/unix/bsd/netbsdlike -e _PC_LINK_MAX src/unix/bsd/netbsdlike/netbsd/mod.rs:1599:11:pub const _PC_LINK_MAX: c_int = 1; src/unix/bsd/netbsdlike/openbsd/mod.rs:1193:11:pub const _PC_LINK_MAX: c_int = 1; Originally reported in fish-shell/fish-shell#11892 (backport rust-lang#4738) (cherry picked from commit b1be455)
According to https://man.netbsd.org/confstr.3 _CS_PATH is obsoleted by sysctl (which has a USER_CS_PATH equivalent), but Linux doesn't have that. So the simplest thing for applications is to use _CS_PATH which is part of POSIX. Define, matching the <unistd.h> header. We could maybe share this definition in src/unix/bsd/netbsdlike/mod.rs, but I saw that existing definitions are not shared either, so I'm not sure. $ grep src/unix/bsd/netbsdlike -e _PC_LINK_MAX src/unix/bsd/netbsdlike/netbsd/mod.rs:1599:11:pub const _PC_LINK_MAX: c_int = 1; src/unix/bsd/netbsdlike/openbsd/mod.rs:1193:11:pub const _PC_LINK_MAX: c_int = 1; Originally reported in fish-shell/fish-shell#11892 (backport #4738) (cherry picked from commit b1be455)
According to
https://man.netbsd.org/confstr.3
_CS_PATH is obsoleted by sysctl (which has a USER_CS_PATH equivalent),
but Linux doesn't have that.
So the simplest thing for applications is to use _CS_PATH which is
part of POSIX. Define, matching the <unistd.h> header.
We could maybe share this definition in src/unix/bsd/netbsdlike/mod.rs,
but I saw that existing definitions are not shared either, so I'm
not sure.
Originally reported in fish-shell/fish-shell#11892