apple: Add openpty(3) and forkpty(3)

This commit is contained in:
Kamal Marhubi 2016-02-27 14:58:43 -05:00
parent b47bc673ba
commit 89a7700e23
3 changed files with 17 additions and 0 deletions

View file

@ -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");
}

View file

@ -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! {

View file

@ -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;