Skip to content

Commit

Permalink
openbsd: constantify some arguments of openpty() and forkpty()
Browse files Browse the repository at this point in the history
OpenBSD recently made termp and winp arguments of openpty() and forkpty() const. 
to match the prototypes in glibc and musl libc.
  • Loading branch information
semarie committed Apr 30, 2022
1 parent d7abb02 commit 90fb41c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/unix/bsd/netbsdlike/mod.rs
Expand Up @@ -688,19 +688,6 @@ extern "C" {
flag: ::c_int,
) -> ::c_int;
pub fn fdatasync(fd: ::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;
pub fn login_tty(fd: ::c_int) -> ::c_int;
pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
Expand Down
14 changes: 14 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Expand Up @@ -2315,6 +2315,20 @@ extern "C" {
attrnamespace: *mut ::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;

#[link_name = "__lutimes50"]
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
#[link_name = "__gettimeofday50"]
Expand Down
14 changes: 14 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Expand Up @@ -1644,6 +1644,20 @@ extern "C" {
pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
pub fn pthread_stackseg_np(thread: ::pthread_t, sinfo: *mut ::stack_t) -> ::c_int;

pub fn openpty(
amaster: *mut ::c_int,
aslave: *mut ::c_int,
name: *mut ::c_char,
termp: *const ::termios,
winp: *const ::winsize,
) -> ::c_int;
pub fn forkpty(
amaster: *mut ::c_int,
name: *mut ::c_char,
termp: *const ::termios,
winp: *const ::winsize,
) -> ::pid_t;

pub fn sysctl(
name: *const ::c_int,
namelen: ::c_uint,
Expand Down

0 comments on commit 90fb41c

Please sign in to comment.