Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenBSD: add sendmmsg and recvmmsg support. #3831

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libc-test/semver/openbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ mknodat
mkostemp
mkostemps
mkstemps
mmsghdr
mount_info
mrand48
msdosfs_args
Expand Down Expand Up @@ -1210,6 +1211,7 @@ readlinkat
reallocarray
reboot
recvmsg
recvmmsg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add sendmmsg and mmsghdr?

regcomp
regerror
regex_t
Expand All @@ -1231,6 +1233,7 @@ sem_init
sem_open
sem_timedwait
sem_unlink
sendmmsg
sendmsg
setdomainname
setgrent
Expand Down
19 changes: 19 additions & 0 deletions src/unix/bsd/netbsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ s! {
pub piod_addr: *mut ::c_void,
pub piod_len: ::size_t,
}

pub struct mmsghdr {
pub msg_hdr: ::msghdr,
pub msg_len: ::c_uint,
}
}

pub const D_T_FMT: ::nl_item = 0;
Expand Down Expand Up @@ -847,6 +852,20 @@ extern "C" {
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;

pub fn sendmmsg(
sockfd: ::c_int,
mmsg: *mut ::mmsghdr,
vlen: ::c_uint,
flags: ::c_int,
) -> ::c_int;
pub fn recvmmsg(
sockfd: ::c_int,
mmsg: *mut ::mmsghdr,
vlen: ::c_uint,
flags: ::c_int,
timeout: *mut ::timespec,
) -> ::c_int;
}

cfg_if! {
Expand Down
19 changes: 0 additions & 19 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,6 @@ s! {
pub sdl_data: [::c_char; 12],
}

pub struct mmsghdr {
pub msg_hdr: ::msghdr,
pub msg_len: ::c_uint,
}

pub struct __exit_status {
pub e_termination: u16,
pub e_exit: u16,
Expand Down Expand Up @@ -2759,20 +2754,6 @@ extern "C" {

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

pub fn sendmmsg(
sockfd: ::c_int,
msgvec: *mut ::mmsghdr,
vlen: ::c_uint,
flags: ::c_int,
) -> ::c_int;
pub fn recvmmsg(
sockfd: ::c_int,
msgvec: *mut ::mmsghdr,
vlen: ::c_uint,
flags: ::c_int,
timeout: *mut ::timespec,
) -> ::c_int;

pub fn _lwp_self() -> lwpid_t;
pub fn memmem(
haystack: *const ::c_void,
Expand Down