Skip to content

Commit

Permalink
Merge pull request rust-lang#3876 from tgross35/backport-chives
Browse files Browse the repository at this point in the history
[0.2] Backport of three pull requests
  • Loading branch information
tgross35 authored Aug 29, 2024
2 parents 99bd0f5 + adafc28 commit fa7bb69
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 22 deletions.
3 changes: 3 additions & 0 deletions libc-test/semver/openbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,7 @@ mknodat
mkostemp
mkostemps
mkstemps
mmsghdr
mount_info
mrand48
msdosfs_args
Expand Down Expand Up @@ -1216,6 +1217,7 @@ readlinkat
reallocarray
reboot
recvmsg
recvmmsg
regcomp
regerror
regex_t
Expand All @@ -1237,6 +1239,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 @@ -848,6 +853,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 @@ -2781,20 +2776,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
1 change: 0 additions & 1 deletion src/unix/linux_like/linux/gnu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,6 @@ extern "C" {
pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;

pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
pub fn glob64(
pattern: *const ::c_char,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5635,6 +5635,8 @@ extern "C" {
) -> ::ssize_t;

pub fn klogctl(syslog_type: ::c_int, bufp: *mut ::c_char, len: ::c_int) -> ::c_int;

pub fn ioctl(fd: ::c_int, request: ::Ioctl, ...) -> ::c_int;
}

// LFS64 extensions
Expand Down
1 change: 0 additions & 1 deletion src/unix/linux_like/linux/musl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,6 @@ extern "C" {
new_limit: *const ::rlimit,
old_limit: *mut ::rlimit,
) -> ::c_int;
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
pub fn ptrace(request: ::c_int, ...) -> ::c_long;
pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
Expand Down
1 change: 0 additions & 1 deletion src/unix/linux_like/linux/uclibc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ pub const UDP_SEGMENT: ::c_int = 103;
pub const YESEXPR: ::c_int = ((5) << 8) | (0);

extern "C" {
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;

pub fn pthread_rwlockattr_getkind_np(
Expand Down
1 change: 1 addition & 0 deletions src/vxworks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,7 @@ pub const S_IFSOCK: ::c_int = 0xc000;
pub const S_ISUID: ::c_int = 0x0800;
pub const S_ISGID: ::c_int = 0x0400;
pub const S_ISTXT: ::c_int = 0x0200;
pub const S_ISVTX: ::c_int = 0o1000;
pub const S_IRUSR: ::c_int = 0x0100;
pub const S_IWUSR: ::c_int = 0x0080;
pub const S_IXUSR: ::c_int = 0x0040;
Expand Down

0 comments on commit fa7bb69

Please sign in to comment.