-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add BOTHER & termios2 to Android & Linux #711
Conversation
32948a9
to
68463c5
Compare
A whitelist is added for this but is it verified anywhere? |
What do you mean verified? I looked through the Linux sources to figure out these values and they should be correct. |
Oh I just mean verified in the sense of libc-test/build.rs. If it's ignored there on all linux platforms, and the value varies across architectures on linux platforms, how do we know it's right? |
@alexcrichton I looked at the Linux sources to figure out what these values are. For situations like this, what is the bar for proving this is correct? I haven't had to do it for |
Constants like CMSPAR are only ignored on mips-unknown-linux-gnu it looks like, meaning it's verified on almost all platforms. BOTHER, however, is validated nowhere. Can this constant not be accessed from C code? If not why not, and how is it supposed to be used in C? If so, how come we can't access it that way? |
BOTHER is only defined in |
I'd be pretty uncomfortable adding this with no verification on any platform basically. I think we need to verify it somewhere automatically to at least enusre it's correct on some platforms. This may require changes to |
☔ The latest upstream changes (presumably #722) made this pull request unmergeable. Please resolve the merge conflicts. |
I'd also like to include I could for now at least support the struct without this constant, though that's definitely less than ideal. |
Note that this branch is now based on #720 as that's needed to implement testing. |
☔ The latest upstream changes (presumably #720) made this pull request unmergeable. Please resolve the merge conflicts. |
@alexcrichton I want to rebase and push this forward, but I'd like to add the termios2 struct to it. That strict is defined using a different value for the NCCS constant. Is it fine to name it NCCS_termios2 and exclude it from testing, as the size of the struct will be checked by the testing code. |
Sure yeah sounds reasonable, I'd probably just not expose the constant if possible |
Just rebased and updated this now that #720 landed. One thing I wasn't able to do was to test the |
I'm not certain why there're failures on |
libc-test/build.rs
Outdated
// The termios2 struct is the same as `termios` on powerpc, so it's actually | ||
// undeclared in the headers. We'll still expose it there to still provide | ||
// some type safety, but we can't check it directly. | ||
"termios2" if !powerpc => false, |
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.
Could this use struct_name
to rename the struct to assert termios2
is the same as termios
on powerpc?
This just looks like |
☔ The latest upstream changes (presumably #747) made this pull request unmergeable. Please resolve the merge conflicts. |
I'm gonna close this due to inactivity, but feel free to reopen with a rebase! |
Looks like I can't reopen this PR, but I'm definitely interested in merging it. |
@alexcrichton This crashes for me with really weird errors when trying to rename |
d87d24e
to
e95e79e
Compare
Note that termios2 doesn't exist on powerpc(64), termios is used instead.
Looks like a spurious failure on |
@bors: r+ |
📌 Commit 6d55c24 has been approved by |
Add BOTHER & termios2 to Android & Linux This should be the same for both the struct and the constant across all Linux/Android platforms, but we'll see!
☀️ Test successful - status-appveyor, status-travis |
This should be the same for both the struct and the constant across all Linux/Android platforms, but we'll see!