Skip to content

Commit 509d9b3

Browse files
authored
Merge pull request #3831 from devnexen/gh3696
OpenBSD: add sendmmsg and recvmmsg support.
2 parents 46e3178 + c369185 commit 509d9b3

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

libc-test/semver/openbsd.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,7 @@ mknodat
11311131
mkostemp
11321132
mkostemps
11331133
mkstemps
1134+
mmsghdr
11341135
mount_info
11351136
mrand48
11361137
msdosfs_args
@@ -1210,6 +1211,7 @@ readlinkat
12101211
reallocarray
12111212
reboot
12121213
recvmsg
1214+
recvmmsg
12131215
regcomp
12141216
regerror
12151217
regex_t
@@ -1231,6 +1233,7 @@ sem_init
12311233
sem_open
12321234
sem_timedwait
12331235
sem_unlink
1236+
sendmmsg
12341237
sendmsg
12351238
setdomainname
12361239
setgrent

src/unix/bsd/netbsdlike/mod.rs

+19
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;
@@ -847,6 +852,20 @@ extern "C" {
847852
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
848853
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
849854
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
855+
856+
pub fn sendmmsg(
857+
sockfd: ::c_int,
858+
mmsg: *mut ::mmsghdr,
859+
vlen: ::c_uint,
860+
flags: ::c_int,
861+
) -> ::c_int;
862+
pub fn recvmmsg(
863+
sockfd: ::c_int,
864+
mmsg: *mut ::mmsghdr,
865+
vlen: ::c_uint,
866+
flags: ::c_int,
867+
timeout: *mut ::timespec,
868+
) -> ::c_int;
850869
}
851870

852871
cfg_if! {

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

-19
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,
@@ -2759,20 +2754,6 @@ extern "C" {
27592754

27602755
pub fn kqueue1(flags: ::c_int) -> ::c_int;
27612756

2762-
pub fn sendmmsg(
2763-
sockfd: ::c_int,
2764-
msgvec: *mut ::mmsghdr,
2765-
vlen: ::c_uint,
2766-
flags: ::c_int,
2767-
) -> ::c_int;
2768-
pub fn recvmmsg(
2769-
sockfd: ::c_int,
2770-
msgvec: *mut ::mmsghdr,
2771-
vlen: ::c_uint,
2772-
flags: ::c_int,
2773-
timeout: *mut ::timespec,
2774-
) -> ::c_int;
2775-
27762757
pub fn _lwp_self() -> lwpid_t;
27772758
pub fn memmem(
27782759
haystack: *const ::c_void,

0 commit comments

Comments
 (0)