Skip to content

Commit

Permalink
Auto merge of #2773 - semarie:openbsd-const, r=Amanieu
Browse files Browse the repository at this point in the history
openbsd: constantify some arguments of openpty() and forkpty()

OpenBSD recently made `termp` and `winp` arguments of `openpty()` and `forkpty()` const.
to match the prototypes in glibc and musl libc.

It was done in [following commit](openbsd/src@78fa49e), which will be part of OpenBSD 7.2 .
  • Loading branch information
bors committed May 5, 2022
2 parents 01d1fcf + 90fb41c commit 9a6c13a
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 9a6c13a

Please sign in to comment.