Skip to content
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 more termios constants #625

Merged
merged 4 commits into from
Jun 26, 2017
Merged

Add more termios constants #625

merged 4 commits into from
Jun 26, 2017

Conversation

Susurrus
Copy link
Contributor

Went through and found some more termios constants that were missing and added them. I skipped some platforms (solaris, uclibc) and assumed Android has the same constants are Linux, as I couldn't find a good reference for what Android exposes, but it generally follows linux, so I assumed the same was true for some of those values.

References:

FreeBSD:

@Susurrus Susurrus force-pushed the termios_more branch 5 times, most recently from 7da6b53 to dbb9239 Compare June 23, 2017 07:43
@Susurrus
Copy link
Contributor Author

Tests pass and I've successfully used these constants in a downstream PR, so I think this should be RTM.

@Susurrus
Copy link
Contributor Author

Nvm, missing some constants on a few platforms I think.

pub const TAB3: ::c_int = 0x00000004;
pub const VT0: ::c_int = 0x00000000;
pub const VT1: ::c_int = 0x00010000;
pub const NL0: ::tcflag_t = 0x00000000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately while likely more correct this is a breaking change, so it'll have to happen in a future PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can file that as a separate PR for that change then. Unfortunate that breaking changes can't be done to libc even though it's < 1.0. Is there a roadmap for getting addressing these breaking changes in a reasonable timeframe?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not currently, no.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I've not changed the datatypes for the non-apply BSD platforms in this PR, can I keep those as tcflag_t types then and just make sure I don't touch the old ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or do you want those constants to be c_int across all platforms?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah switching to tcflag_t seems fine by me.

@Susurrus
Copy link
Contributor Author

This failed CI because the Mac builds mostly timed out, but they should pass. Could someone with Travis permissions rerun the build or r+ it so homu will?

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jun 25, 2017

📌 Commit 8f4de54 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Jun 25, 2017

⌛ Testing commit 8f4de54 with merge 46f98a1...

bors added a commit that referenced this pull request Jun 25, 2017
Add more termios constants

Went through and found some more termios constants that were missing and added them. I skipped some platforms (solaris, uclibc) and assumed Android has the same constants are Linux, as I couldn't find a good reference for what Android exposes, but it generally follows linux, so I assumed the same was true for some of those values.

## References:
 FreeBSD:
   * https://github.com/freebsd/freebsd/blob/d39171bb1f2256bd3bf018314aec600f79b89bc6/sys/sys/_termios.h
   * https://github.com/freebsd/freebsd/blob/d39171bb1f2256bd3bf018314aec600f79b89bc6/include/termios.h
 NetBSD: https://github.com/NetBSD/src/blob/0bff031265b50be8e8b7719aed82212928d6c1df/sys/sys/termios.h
 musl: /usr/x86_64-linux-musl/include/bits/termios.h (identical to Linux-x86_64)
 linux: /usr/include/bits/termios.h
 OpenBSD: https://github.com/openbsd/src/blob/5271000b44abe23907b73bbb3aa38ddf4a0bce08/sys/sys/termios.h
 DragonFlyBSD:
   * https://github.com/DragonFlyBSD/DragonFlyBSD/blob/ddad68003a1b070d6955ae737c834cd3267d3ead/sys/sys/_termios.h
   * https://github.com/DragonFlyBSD/DragonFlyBSD/blob/ddad68003a1b070d6955ae737c834cd3267d3ead/sys/sys/termios.h
 Android: Just use the same as Linux
 uclibc: skipped
 haiku-os: http://cgit.haiku-os.org/haiku/tree/headers/posix/termios.h
 mac: /usr/include/sys/termios.h and /usr/include/sys/_types/_posix_vdisable.h
 solaris: skipped
 bitrig (follows openbsd): https://github.com/bitrig/bitrig/blob/d31f5220a98fae4e74abafe27c8d150843cc8105/sys/sys/termios.h
@bors
Copy link
Contributor

bors commented Jun 25, 2017

💔 Test failed - status-travis

@Susurrus
Copy link
Contributor Author

Still failing because OS X builds in Travis aren't even running. I've pushed this branch again to force a new test run, and hopefully this one passes.

@alexcrichton
Copy link
Member

@bors: retry

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jun 25, 2017

📌 Commit 297d5b7 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Jun 25, 2017

⌛ Testing commit 297d5b7 with merge d4a55d5...

bors added a commit that referenced this pull request Jun 25, 2017
Add more termios constants

Went through and found some more termios constants that were missing and added them. I skipped some platforms (solaris, uclibc) and assumed Android has the same constants are Linux, as I couldn't find a good reference for what Android exposes, but it generally follows linux, so I assumed the same was true for some of those values.

## References:
 FreeBSD:
   * https://github.com/freebsd/freebsd/blob/d39171bb1f2256bd3bf018314aec600f79b89bc6/sys/sys/_termios.h
   * https://github.com/freebsd/freebsd/blob/d39171bb1f2256bd3bf018314aec600f79b89bc6/include/termios.h
 NetBSD: https://github.com/NetBSD/src/blob/0bff031265b50be8e8b7719aed82212928d6c1df/sys/sys/termios.h
 musl: /usr/x86_64-linux-musl/include/bits/termios.h (identical to Linux-x86_64)
 linux: /usr/include/bits/termios.h
 OpenBSD: https://github.com/openbsd/src/blob/5271000b44abe23907b73bbb3aa38ddf4a0bce08/sys/sys/termios.h
 DragonFlyBSD:
   * https://github.com/DragonFlyBSD/DragonFlyBSD/blob/ddad68003a1b070d6955ae737c834cd3267d3ead/sys/sys/_termios.h
   * https://github.com/DragonFlyBSD/DragonFlyBSD/blob/ddad68003a1b070d6955ae737c834cd3267d3ead/sys/sys/termios.h
 Android: Just use the same as Linux
 uclibc: skipped
 haiku-os: http://cgit.haiku-os.org/haiku/tree/headers/posix/termios.h
 mac: /usr/include/sys/termios.h and /usr/include/sys/_types/_posix_vdisable.h
 solaris: skipped
 bitrig (follows openbsd): https://github.com/bitrig/bitrig/blob/d31f5220a98fae4e74abafe27c8d150843cc8105/sys/sys/termios.h
@bors
Copy link
Contributor

bors commented Jun 26, 2017

💔 Test failed - status-travis

@Susurrus
Copy link
Contributor Author

Looks like something's wrong with the mac runners on Travis right now, and I don't know how to fix that. travis's status page doesn't indicate anything bad is going on.

@alexcrichton
Copy link
Member

@bors: retry

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jun 26, 2017

💡 This pull request was already approved, no need to approve it again.

  • This pull request previously failed. You should add more commits to fix the bug, or use retry to trigger a build again.
  • There's another pull request that is currently being tested, blocking this pull request: [uclibc] add more structs to x86_64 #626

@bors
Copy link
Contributor

bors commented Jun 26, 2017

📌 Commit 297d5b7 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Jun 26, 2017

⌛ Testing commit 297d5b7 with merge e24f3f8...

bors added a commit that referenced this pull request Jun 26, 2017
Add more termios constants

Went through and found some more termios constants that were missing and added them. I skipped some platforms (solaris, uclibc) and assumed Android has the same constants are Linux, as I couldn't find a good reference for what Android exposes, but it generally follows linux, so I assumed the same was true for some of those values.

## References:
 FreeBSD:
   * https://github.com/freebsd/freebsd/blob/d39171bb1f2256bd3bf018314aec600f79b89bc6/sys/sys/_termios.h
   * https://github.com/freebsd/freebsd/blob/d39171bb1f2256bd3bf018314aec600f79b89bc6/include/termios.h
 NetBSD: https://github.com/NetBSD/src/blob/0bff031265b50be8e8b7719aed82212928d6c1df/sys/sys/termios.h
 musl: /usr/x86_64-linux-musl/include/bits/termios.h (identical to Linux-x86_64)
 linux: /usr/include/bits/termios.h
 OpenBSD: https://github.com/openbsd/src/blob/5271000b44abe23907b73bbb3aa38ddf4a0bce08/sys/sys/termios.h
 DragonFlyBSD:
   * https://github.com/DragonFlyBSD/DragonFlyBSD/blob/ddad68003a1b070d6955ae737c834cd3267d3ead/sys/sys/_termios.h
   * https://github.com/DragonFlyBSD/DragonFlyBSD/blob/ddad68003a1b070d6955ae737c834cd3267d3ead/sys/sys/termios.h
 Android: Just use the same as Linux
 uclibc: skipped
 haiku-os: http://cgit.haiku-os.org/haiku/tree/headers/posix/termios.h
 mac: /usr/include/sys/termios.h and /usr/include/sys/_types/_posix_vdisable.h
 solaris: skipped
 bitrig (follows openbsd): https://github.com/bitrig/bitrig/blob/d31f5220a98fae4e74abafe27c8d150843cc8105/sys/sys/termios.h
@bors
Copy link
Contributor

bors commented Jun 26, 2017

💔 Test failed - status-travis

@alexcrichton
Copy link
Member

alexcrichton commented Jun 26, 2017 via email

@bors
Copy link
Contributor

bors commented Jun 26, 2017

⌛ Testing commit 297d5b7 with merge f53b95a...

bors added a commit that referenced this pull request Jun 26, 2017
Add more termios constants

Went through and found some more termios constants that were missing and added them. I skipped some platforms (solaris, uclibc) and assumed Android has the same constants are Linux, as I couldn't find a good reference for what Android exposes, but it generally follows linux, so I assumed the same was true for some of those values.

## References:
 FreeBSD:
   * https://github.com/freebsd/freebsd/blob/d39171bb1f2256bd3bf018314aec600f79b89bc6/sys/sys/_termios.h
   * https://github.com/freebsd/freebsd/blob/d39171bb1f2256bd3bf018314aec600f79b89bc6/include/termios.h
 NetBSD: https://github.com/NetBSD/src/blob/0bff031265b50be8e8b7719aed82212928d6c1df/sys/sys/termios.h
 musl: /usr/x86_64-linux-musl/include/bits/termios.h (identical to Linux-x86_64)
 linux: /usr/include/bits/termios.h
 OpenBSD: https://github.com/openbsd/src/blob/5271000b44abe23907b73bbb3aa38ddf4a0bce08/sys/sys/termios.h
 DragonFlyBSD:
   * https://github.com/DragonFlyBSD/DragonFlyBSD/blob/ddad68003a1b070d6955ae737c834cd3267d3ead/sys/sys/_termios.h
   * https://github.com/DragonFlyBSD/DragonFlyBSD/blob/ddad68003a1b070d6955ae737c834cd3267d3ead/sys/sys/termios.h
 Android: Just use the same as Linux
 uclibc: skipped
 haiku-os: http://cgit.haiku-os.org/haiku/tree/headers/posix/termios.h
 mac: /usr/include/sys/termios.h and /usr/include/sys/_types/_posix_vdisable.h
 solaris: skipped
 bitrig (follows openbsd): https://github.com/bitrig/bitrig/blob/d31f5220a98fae4e74abafe27c8d150843cc8105/sys/sys/termios.h
@bors
Copy link
Contributor

bors commented Jun 26, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing f53b95a to master...

@bors bors merged commit 297d5b7 into rust-lang:master Jun 26, 2017
@Susurrus
Copy link
Contributor Author

Man, Travis was super difficult on this PR. Thanks tho for helping push this through!

@Susurrus Susurrus deleted the termios_more branch June 26, 2017 22:50
bors added a commit that referenced this pull request May 28, 2019
Correct datatype for various termios constants

This was a part of #625, but I moved it to a separate PR as it's a breaking change and those are currently blocked for Tier 1 platforms.
bors added a commit that referenced this pull request May 28, 2019
Correct datatype for various termios constants

This was a part of #625, but I moved it to a separate PR as it's a breaking change and those are currently blocked for Tier 1 platforms.
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.

None yet

3 participants