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

Support for ttyname and ttyname_r #1204

Closed
Artoria2e5 opened this issue Apr 4, 2020 · 1 comment · Fixed by #1259
Closed

Support for ttyname and ttyname_r #1204

Artoria2e5 opened this issue Apr 4, 2020 · 1 comment · Fixed by #1259

Comments

@Artoria2e5
Copy link

Artoria2e5 commented Apr 4, 2020

POSIX: https://pubs.opengroup.org/onlinepubs/9699919799/functions/ttyname.html

pub unsafe fn ttyname(fd: RawFd) -> Result<String>;
pub fn ttyname_r(fd: RawFd) -> Result<String>;

ttyname and ttyname_r are basically ptsname that works on any TTY fds, not just those associated with a PTY slave device. The latter is a pretty useful portable alternative to ptsname_r.

The functions are found on basically every nix platform; see libc crate for details about a macOS compliance fix it has.

@asomers
Copy link
Member

asomers commented May 2, 2020

Nix operates on a "patches welcome" basis. Us maintainers are basically just curators. Do you care to submit a patch?

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 a pull request may close this issue.

2 participants