Skip to content

Commit b8fa6f0

Browse files
committed
OpenBSD: add sendmmsg and recvmmsg support.
close #3696
1 parent 50b4720 commit b8fa6f0

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

libc-test/semver/openbsd.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,7 @@ readlinkat
12101210
reallocarray
12111211
reboot
12121212
recvmsg
1213+
recvmmsg
12131214
regcomp
12141215
regerror
12151216
regex_t

src/unix/bsd/netbsdlike/mod.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ s! {
9292
pub piod_addr: *mut ::c_void,
9393
pub piod_len: ::size_t,
9494
}
95+
96+
pub struct mmsghdr {
97+
pub msg_hdr: ::msghdr,
98+
pub msg_len: ::c_uint,
99+
}
95100
}
96101

97102
pub const D_T_FMT: ::nl_item = 0;
@@ -858,6 +863,20 @@ extern "C" {
858863
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
859864
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
860865
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
866+
867+
pub fn sendmmsg(
868+
sockfd: ::c_int,
869+
mmsg: *mut ::mmsghdr,
870+
vlen: ::c_uint,
871+
flags: ::c_int,
872+
) -> ::c_int;
873+
pub fn recvmmsg(
874+
sockfd: ::c_int,
875+
mmsg: *mut ::mmsghdr,
876+
vlen: ::c_uint,
877+
flags: ::c_int,
878+
timeout: *mut ::timespec,
879+
) -> ::c_int;
861880
}
862881

863882
cfg_if! {

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,6 @@ s! {
401401
pub sdl_data: [::c_char; 12],
402402
}
403403

404-
pub struct mmsghdr {
405-
pub msg_hdr: ::msghdr,
406-
pub msg_len: ::c_uint,
407-
}
408-
409404
pub struct __exit_status {
410405
pub e_termination: u16,
411406
pub e_exit: u16,
@@ -2750,20 +2745,6 @@ extern "C" {
27502745

27512746
pub fn kqueue1(flags: ::c_int) -> ::c_int;
27522747

2753-
pub fn sendmmsg(
2754-
sockfd: ::c_int,
2755-
msgvec: *mut ::mmsghdr,
2756-
vlen: ::c_uint,
2757-
flags: ::c_int,
2758-
) -> ::c_int;
2759-
pub fn recvmmsg(
2760-
sockfd: ::c_int,
2761-
msgvec: *mut ::mmsghdr,
2762-
vlen: ::c_uint,
2763-
flags: ::c_int,
2764-
timeout: *mut ::timespec,
2765-
) -> ::c_int;
2766-
27672748
pub fn _lwp_self() -> lwpid_t;
27682749
pub fn memmem(
27692750
haystack: *const ::c_void,

0 commit comments

Comments
 (0)