Skip to content

termios::Termios::OutputModes does not expost some const for apple & musl #1706

Open

Description

Activity

  1. xtqqczze commented on Oct 15, 2026

    @xtqqczze
    Contributor

    It seems OLCUC does not exist in the libc crate for Apple targets, we should check whether it exists in the Apple headers.

  2. oech3 commented on Oct 15, 2026

    @oech3
    Author

    While some investigation for macOS is needed, this issue is still open for musl.

  3. xtqqczze commented on Oct 15, 2026

    @xtqqczze
    Contributor

    It doesn't exist in termios.h:

    cat $(xcrun --show-sdk-path)/usr/include/sys/termios.h | grep OLCUC
  4. changed the title [-]rustix::termios::Termios::OutputModes does not expost some const e.g. OLCUC for musl and macOS[/-] [+]termios::Termios::OutputModes does not expost some const e.g. OLCUC for musl and macOS[/+] on Oct 15, 2026
  5. xtqqczze commented on Oct 16, 2026

    @xtqqczze
    Contributor

    @oech3 This issue does not apply to Apple targets, as OLCUC is not defined in Apple's headers. Please update the issue title and description.

  6. oech3 commented on Oct 16, 2026

    @oech3
    Author

    I'd like to wait maintainer's response. Kernel itself still might have something (or just an spare of NCCS).

  7. xtqqczze commented on Oct 16, 2026

    @xtqqczze
    Contributor

    We shouldn't claim that a constant is missing without evidence that the platform is expected to define it. Please ensure the title and description accurately reflect the platforms affected by this issue.

  8. oech3 commented on Oct 16, 2026

    @oech3
    Author
  9. xtqqczze commented on Oct 16, 2026

    @xtqqczze
    Contributor

    OLCUC is not defined in XNU, Apple's open-source kernel:

    https://github.com/apple-oss-distributions/xnu/blob/main/bsd/sys/termios.h

  10. xtqqczze commented on Oct 16, 2026

    @xtqqczze
    Contributor

    To make this more practical, OLCUC is not defined in the libc crate for Apple targets, so it cannot currently be implemented in rustix. If you believe this constant should be available, please consider opening an issue upstream with supporting evidence.

  11. changed the title [-]termios::Termios::OutputModes does not expost some const e.g. OLCUC for musl and macOS[/-] [+]termios::Termios::OutputModes does not expost some const for musl[/+] on Oct 16, 2026
  12. oech3 commented on Oct 16, 2026

    @oech3
    Author

    I updated this issue.

  13. oech3 commented on Oct 16, 2026

    @oech3
    Author

    OLCUC is not defined in the libc

    Well... but it actually compiles...

  14. xtqqczze commented on Oct 16, 2026

    @xtqqczze
    Contributor
    error[E0425]: cannot find value `OLCUC` in module `c`
       --> src/termios/types.rs:331:26
        |
    331 |         const OLCUC = c::OLCUC;
        |                          ^^^^^ not found in `c`
  15. oech3 commented on Oct 16, 2026

    @oech3
    Author

    But CI complied it.

  16. xtqqczze commented on Oct 16, 2026

    @xtqqczze
    Contributor

    OLCUC is not defined in the libc crate for Apple targets, so it cannot be implemented in rustix without an upstream definition. You can verify this by removing the apple exclusion from the conditional compilation attributes and running cargo check for an Apple target:

    --- a/src/termios/types.rs
    +++ b/src/termios/types.rs
    @@ -320,7 +320,6 @@ bitflags! {
     
             /// `OLCUC`
             #[cfg(not(any(
    -            apple,
                 freebsdlike,
                 target_os = "aix",
                 target_os = "netbsd",
    $ cargo check --features=all-apis --target aarch64-apple-darwin
    error[E0425]: cannot find value `OLCUC` in module `c`

    If you believe OLCUC is supported on Apple targets, please consider opening an issue upstream with supporting evidence.

  17. oech3 commented on Oct 16, 2026

    @oech3
    Author

    I understood that source code is properly gated ,but CI compiled it.

  18. oech3 commented on Oct 16, 2026

    @oech3
    Author

    https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/bsd/sys/termios.h#L149 says
    Begin unimplemented features. But const seems given. Though they might be compiled out at most cases...

  19. oech3 commented on Oct 16, 2026

    @oech3
    Author

    programs will currently result in unexpected behaviour.

  20. oech3 commented on Oct 16, 2026

    @oech3
    Author

    Considering uutils/coreutils#15417 (comment) , we can request to support them.
    However, they are probably useful only for uutils and it might no worth to add to rustix which should be "safe".

  21. changed the title [-]termios::Termios::OutputModes does not expost some const for musl[/-] [+]termios::Termios::OutputModes does not expost some const for apple & musl[/+] on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions