Skip to content

Commit

Permalink
Merge pull request rust-lang#202 from kamalmarhubi/openpty
Browse files Browse the repository at this point in the history
apple: Add openpty(3) and forkpty(3)
  • Loading branch information
alexcrichton committed Mar 9, 2016
2 parents b47bc67 + 89a7700 commit 04213bb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ fn main() {
cfg.header("mach-o/dyld.h");
cfg.header("mach/mach_time.h");
cfg.header("malloc/malloc.h");
cfg.header("util.h");
if target.starts_with("x86") {
cfg.header("crt_externs.h");
}
Expand Down
9 changes: 9 additions & 0 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,15 @@ extern {
len: *mut ::off_t,
hdtr: *mut ::sf_hdtr,
flags: ::c_int) -> ::c_int;
pub fn openpty(amaster: *mut ::c_int,
aslave: *mut ::c_int,
name: *mut ::c_char,
termp: *mut termios,
winp: *mut ::winsize) -> ::c_int;
pub fn forkpty(amaster: *mut ::c_int,
name: *mut ::c_char,
termp: *mut termios,
winp: *mut ::winsize) -> ::pid_t;
}

cfg_if! {
Expand Down
7 changes: 7 additions & 0 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ s! {
pub events: ::c_short,
pub revents: ::c_short,
}

pub struct winsize {
pub ws_row: ::c_ushort,
pub ws_col: ::c_ushort,
pub ws_xpixel: ::c_ushort,
pub ws_ypixel: ::c_ushort,
}
}

pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
Expand Down

0 comments on commit 04213bb

Please sign in to comment.