Skip to content

Commit 99854f3

Browse files
committed
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); ```
2 parents a73d6bc + ccdc5eb commit 99854f3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/unix/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,10 @@ extern {
754754
pub fn tcgetpgrp(fd: ::c_int) -> pid_t;
755755
pub fn tcsetpgrp(fd: ::c_int, pgrp: ::pid_t) -> ::c_int;
756756
pub fn ttyname(fd: ::c_int) -> *mut c_char;
757+
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
758+
link_name = "ttyname_r$UNIX2003")]
759+
pub fn ttyname_r(fd: ::c_int,
760+
buf: *mut c_char, buflen: ::size_t) -> ::c_int;
757761
pub fn unlink(c: *const c_char) -> ::c_int;
758762
#[cfg_attr(all(target_os = "macos", target_arch = "x86"),
759763
link_name = "wait$UNIX2003")]

0 commit comments

Comments
 (0)