diff options
author | bors <bors@rust-lang.org> | 2019-06-24 05:07:16 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2019-06-24 05:07:16 +0000 |
commit | 99854f378a0ff594f8248f15459169b879422660 (patch) | |
tree | e9b7ac0a75ebf14020dbb28103a9db287df63adb /src/unix/mod.rs | |
parent | a73d6bc00d0a7d7c63028e6b69ed9b46734a2369 (diff) | |
parent | ccdc5ebc2d5bd5c41fb0e46ebc1de651a31c3c9c (diff) | |
download | rust-libc-99854f378a0ff594f8248f15459169b879422660.tar.gz |
Auto merge of #1350 - dbrgn:ttyname_r, r=gnzlbg
Add ttyname_r
I hope this is correct. Parameter types taken from `man ttyname`.
```c
int ttyname_r(int fd, char *buf, size_t buflen);
```
Diffstat (limited to 'src/unix/mod.rs')
-rw-r--r-- | src/unix/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 24df725655..8295dfc020 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -754,6 +754,10 @@ extern { pub fn tcgetpgrp(fd: ::c_int) -> pid_t; pub fn tcsetpgrp(fd: ::c_int, pgrp: ::pid_t) -> ::c_int; pub fn ttyname(fd: ::c_int) -> *mut c_char; + #[cfg_attr(all(target_os = "macos", target_arch = "x86"), + link_name = "ttyname_r$UNIX2003")] + pub fn ttyname_r(fd: ::c_int, + buf: *mut c_char, buflen: ::size_t) -> ::c_int; pub fn unlink(c: *const c_char) -> ::c_int; #[cfg_attr(all(target_os = "macos", target_arch = "x86"), link_name = "wait$UNIX2003")] |