Skip to content

Commit 90fb41c

Browse files
committed
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.
1 parent d7abb02 commit 90fb41c

File tree

3 files changed

+28
-13
lines changed

3 files changed

+28
-13
lines changed

src/unix/bsd/netbsdlike/mod.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -688,19 +688,6 @@ extern "C" {
688688
flag: ::c_int,
689689
) -> ::c_int;
690690
pub fn fdatasync(fd: ::c_int) -> ::c_int;
691-
pub fn openpty(
692-
amaster: *mut ::c_int,
693-
aslave: *mut ::c_int,
694-
name: *mut ::c_char,
695-
termp: *mut termios,
696-
winp: *mut ::winsize,
697-
) -> ::c_int;
698-
pub fn forkpty(
699-
amaster: *mut ::c_int,
700-
name: *mut ::c_char,
701-
termp: *mut termios,
702-
winp: *mut ::winsize,
703-
) -> ::pid_t;
704691
pub fn login_tty(fd: ::c_int) -> ::c_int;
705692
pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
706693
pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;

src/unix/bsd/netbsdlike/netbsd/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,6 +2315,20 @@ extern "C" {
23152315
attrnamespace: *mut ::c_int,
23162316
) -> ::c_int;
23172317

2318+
pub fn openpty(
2319+
amaster: *mut ::c_int,
2320+
aslave: *mut ::c_int,
2321+
name: *mut ::c_char,
2322+
termp: *mut ::termios,
2323+
winp: *mut ::winsize,
2324+
) -> ::c_int;
2325+
pub fn forkpty(
2326+
amaster: *mut ::c_int,
2327+
name: *mut ::c_char,
2328+
termp: *mut ::termios,
2329+
winp: *mut ::winsize,
2330+
) -> ::pid_t;
2331+
23182332
#[link_name = "__lutimes50"]
23192333
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
23202334
#[link_name = "__gettimeofday50"]

src/unix/bsd/netbsdlike/openbsd/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,20 @@ extern "C" {
16441644
pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
16451645
pub fn pthread_stackseg_np(thread: ::pthread_t, sinfo: *mut ::stack_t) -> ::c_int;
16461646

1647+
pub fn openpty(
1648+
amaster: *mut ::c_int,
1649+
aslave: *mut ::c_int,
1650+
name: *mut ::c_char,
1651+
termp: *const ::termios,
1652+
winp: *const ::winsize,
1653+
) -> ::c_int;
1654+
pub fn forkpty(
1655+
amaster: *mut ::c_int,
1656+
name: *mut ::c_char,
1657+
termp: *const ::termios,
1658+
winp: *const ::winsize,
1659+
) -> ::pid_t;
1660+
16471661
pub fn sysctl(
16481662
name: *const ::c_int,
16491663
namelen: ::c_uint,

0 commit comments

Comments
 (0)