Skip to content

Commit

Permalink
Merge pull request #3980 from tgross35/backport-squash
Browse files Browse the repository at this point in the history
[0.2] Backports
  • Loading branch information
tgross35 authored Oct 16, 2024
2 parents c49fe92 + f39e871 commit 31f746a
Show file tree
Hide file tree
Showing 20 changed files with 397 additions and 43 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,14 @@ targets = [
"riscv32i-unknown-none-elf",
"riscv32imac-unknown-none-elf",
"riscv32imc-unknown-none-elf",
"riscv32-wrs-vxworks",
"riscv64gc-unknown-freebsd",
"riscv64gc-unknown-hermit",
"riscv64gc-unknown-linux-gnu",
"riscv64gc-unknown-linux-musl",
"riscv64gc-unknown-none-elf",
"riscv64imac-unknown-none-elf",
"riscv64-wrs-vxworks",
"s390x-unknown-linux-gnu",
"s390x-unknown-linux-musl",
"sparc-unknown-linux-gnu",
Expand Down
2 changes: 2 additions & 0 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,13 @@ riscv32i-unknown-none-elf \
riscv32imac-unknown-none-elf \
riscv32imc-unknown-none-elf \
riscv32gc-unknown-linux-gnu \
riscv32-wrs-vxworks \
riscv64gc-unknown-freebsd \
riscv64gc-unknown-hermit \
riscv64gc-unknown-linux-musl \
riscv64gc-unknown-none-elf \
riscv64imac-unknown-none-elf \
riscv64-wrs-vxworks \
s390x-unknown-linux-musl \
sparc-unknown-linux-gnu \
sparc64-unknown-netbsd \
Expand Down
25 changes: 25 additions & 0 deletions libc-test/semver/dragonfly.txt
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,31 @@ RLIMIT_STACK
RLIMIT_VMEM
RLIM_INFINITY
RLIM_NLIMITS
RTF_XRESOLVE
RTF_LLINFO
RTF_PROTO3
RTF_PINNED
RTF_LOCAL
RTF_BROADCAST
RTF_MULTICAST
RTM_LOCK
RTM_RESOLVE
RTM_NEWADDR
RTM_DELADDR
RTM_IFINFO
RTM_NEWMADDR
RTM_DELMADDR
RTM_IFANNOUNCE
RTM_IEEE80211
RTF_CLONING
RTF_PRCLONING
RTF_WASCLONED
RTF_MPLSOPS
RTM_VERSION
RTAX_MPLS1
RTAX_MPLS2
RTAX_MPLS3
RTAX_MAX
RTLD_NEXT
RTLD_NODELETE
RTLD_NOLOAD
Expand Down
21 changes: 21 additions & 0 deletions libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,7 @@ PL_FLAG_SI
PM_STR
POLLINIGNEOF
POLLRDBAND
POLLRDHUP
POLLRDNORM
POLLSTANDARD
POLLWRBAND
Expand Down Expand Up @@ -1218,6 +1219,26 @@ RLIMIT_UMTXP
RLIMIT_VMEM
RLIM_INFINITY
RLIM_NLIMITS
RTF_XRESOLVE
RTF_LLINFO
RTF_PROTO3
RTF_PINNED
RTF_LOCAL
RTF_BROADCAST
RTF_MULTICAST
RTM_LOCK
RTM_RESOLVE
RTM_NEWADDR
RTM_DELADDR
RTM_IFINFO
RTM_NEWMADDR
RTM_DELMADDR
RTM_IFANNOUNCE
RTM_IEEE80211
RTF_LLDATA
RTF_FIXEDMTU
RTM_VERSION
RTAX_MAX
RTLD_NEXT
RTLD_NODELETE
RTLD_NOLOAD
Expand Down
11 changes: 11 additions & 0 deletions libc-test/semver/illumos.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
O_RSYNC
POLLRDHUP
POSIX_FADV_DONTNEED
POSIX_FADV_NOREUSE
POSIX_FADV_NORMAL
POSIX_FADV_RANDOM
POSIX_FADV_SEQUENTIAL
POSIX_FADV_WILLNEED
posix_fadvise
posix_fallocate
pthread_attr_get_np
pthread_attr_getstackaddr
pthread_attr_setstack
ptsname_r
1 change: 0 additions & 1 deletion libc-test/semver/linux-musl.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# TODO: musl.
AF_IB
AF_MPLS
AF_XDP
Expand Down
25 changes: 25 additions & 0 deletions libc-test/semver/netbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ CLD_EXITED
CLD_KILLED
CLD_STOPPED
CLD_TRAPPED
CLOCK_PROCESS_CPUTIME_ID
CLOCK_THREAD_CPUTIME_ID
CMSG_DATA
CMSG_FIRSTHDR
CMSG_LEN
Expand Down Expand Up @@ -927,6 +929,28 @@ RLIM_INFINITY
RLIM_NLIMITS
RLIM_SAVED_CUR
RLIM_SAVED_MAX
RTF_MASK
RTF_CONNECTED
RTF_ANNOUNCE
RTF_SRC
RTF_LOCAL
RTF_BROADCAST
RTF_UPDATING
RTF_DONTCHANGEIFA
RTM_VERSION
RTM_LOCK
RTM_IFANNOUNCE
RTM_IEEE80211
RTM_SETGATE
RTM_LLINFO_UPD
RTM_IFINFO
RTM_OCHGADDR
RTM_NEWADDR
RTM_DELADDR
RTM_CHGADDR
RTA_TAG
RTAX_TAG
RTAX_MAX
RTLD_NEXT
RTLD_NOLOAD
RTLD_SELF
Expand Down Expand Up @@ -1567,6 +1591,7 @@ sync
syscall
sysctl
sysctlbyname
sysctlnametomib
sysctldesc
tcp_info
telldir
Expand Down
42 changes: 42 additions & 0 deletions libc-test/semver/openbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,50 @@ RLIM_INFINITY
RLIM_NLIMITS
RLIM_SAVED_CUR
RLIM_SAVED_MAX
RTA_BFD
RTA_DNS
RTA_LABEL
RTA_SEARCH
RTA_SRC
RTA_SRCMASK
RTA_STATIC
RTAX_BFD
RTAX_DNS
RTAX_LABEL
RTAX_MAX
RTAX_SEARCH
RTAX_SRC
RTAX_SRCMASK
RTAX_STATIC
RTF_ANNOUNCE
RTF_BFD
RTF_BROADCAST
RTF_CACHED
RTF_CLONED
RTF_CLONING
RTF_CONNECTED
RTF_FMASK
RTF_LLINFO
RTF_LOCAL
RTF_MPATH
RTF_MPLS
RTF_MULTICAST
RTF_PROTO3
RTLD_NEXT
RTLD_SELF
RTM_80211INFO
RTM_BFD
RTM_CHGADDRATTR
RTM_DELADDR
RTM_DESYNC
RTM_IFANNOUNCE
RTM_IFINFO
RTM_INVALIDATE
RTM_NEWADDR
RTM_PROPOSAL
RTM_RESOLVE
RTM_SOURCE
RTM_VERSION
RUSAGE_CHILDREN
RUSAGE_SELF
RUSAGE_THREAD
Expand Down
37 changes: 0 additions & 37 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4940,22 +4940,11 @@ pub const XATTR_SHOWCOMPRESSION: ::c_int = 0x0020;
pub const NET_RT_IFLIST2: ::c_int = 0x0006;

// net/route.h
pub const RTF_UP: ::c_int = 0x1;
pub const RTF_GATEWAY: ::c_int = 0x2;
pub const RTF_HOST: ::c_int = 0x4;
pub const RTF_REJECT: ::c_int = 0x8;
pub const RTF_DYNAMIC: ::c_int = 0x10;
pub const RTF_MODIFIED: ::c_int = 0x20;
pub const RTF_DONE: ::c_int = 0x40;
pub const RTF_DELCLONE: ::c_int = 0x80;
pub const RTF_CLONING: ::c_int = 0x100;
pub const RTF_XRESOLVE: ::c_int = 0x200;
pub const RTF_LLINFO: ::c_int = 0x400;
pub const RTF_STATIC: ::c_int = 0x800;
pub const RTF_BLACKHOLE: ::c_int = 0x1000;
pub const RTF_NOIFREF: ::c_int = 0x2000;
pub const RTF_PROTO2: ::c_int = 0x4000;
pub const RTF_PROTO1: ::c_int = 0x8000;
pub const RTF_PRCLONING: ::c_int = 0x10000;
pub const RTF_WASCLONED: ::c_int = 0x20000;
pub const RTF_PROTO3: ::c_int = 0x40000;
Expand All @@ -4974,13 +4963,6 @@ pub const RTF_GLOBAL: ::c_int = 0x40000000;
pub const RTM_VERSION: ::c_int = 5;

// Message types
pub const RTM_ADD: ::c_int = 0x1;
pub const RTM_DELETE: ::c_int = 0x2;
pub const RTM_CHANGE: ::c_int = 0x3;
pub const RTM_GET: ::c_int = 0x4;
pub const RTM_LOSING: ::c_int = 0x5;
pub const RTM_REDIRECT: ::c_int = 0x6;
pub const RTM_MISS: ::c_int = 0x7;
pub const RTM_LOCK: ::c_int = 0x8;
pub const RTM_OLDADD: ::c_int = 0x9;
pub const RTM_OLDDEL: ::c_int = 0xa;
Expand All @@ -5004,25 +4986,6 @@ pub const RTV_SSTHRESH: ::c_int = 0x20;
pub const RTV_RTT: ::c_int = 0x40;
pub const RTV_RTTVAR: ::c_int = 0x80;

// Bitmask values for rtm_addrs.
pub const RTA_DST: ::c_int = 0x1;
pub const RTA_GATEWAY: ::c_int = 0x2;
pub const RTA_NETMASK: ::c_int = 0x4;
pub const RTA_GENMASK: ::c_int = 0x8;
pub const RTA_IFP: ::c_int = 0x10;
pub const RTA_IFA: ::c_int = 0x20;
pub const RTA_AUTHOR: ::c_int = 0x40;
pub const RTA_BRD: ::c_int = 0x80;

// Index offsets for sockaddr array for alternate internal encoding.
pub const RTAX_DST: ::c_int = 0;
pub const RTAX_GATEWAY: ::c_int = 1;
pub const RTAX_NETMASK: ::c_int = 2;
pub const RTAX_GENMASK: ::c_int = 3;
pub const RTAX_IFP: ::c_int = 4;
pub const RTAX_IFA: ::c_int = 5;
pub const RTAX_AUTHOR: ::c_int = 6;
pub const RTAX_BRD: ::c_int = 7;
pub const RTAX_MAX: ::c_int = 8;

pub const KERN_PROCARGS2: ::c_int = 49;
Expand Down
13 changes: 13 additions & 0 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,19 @@ pub const NGROUPS: usize = 16;
pub const RB_PAUSE: ::c_int = 0x40000;
pub const RB_VIDEO: ::c_int = 0x20000000;

// net/route.h
pub const RTF_CLONING: ::c_int = 0x100;
pub const RTF_PRCLONING: ::c_int = 0x10000;
pub const RTF_WASCLONED: ::c_int = 0x20000;
pub const RTF_MPLSOPS: ::c_int = 0x1000000;

pub const RTM_VERSION: ::c_int = 7;

pub const RTAX_MPLS1: ::c_int = 8;
pub const RTAX_MPLS2: ::c_int = 9;
pub const RTAX_MPLS3: ::c_int = 10;
pub const RTAX_MAX: ::c_int = 11;

const_fn! {
{const} fn _CMSG_ALIGN(n: usize) -> usize {
(n + (::mem::size_of::<::c_long>() - 1)) & !(::mem::size_of::<::c_long>() - 1)
Expand Down
9 changes: 9 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2894,6 +2894,7 @@ pub const POSIX_FADV_DONTNEED: ::c_int = 4;
pub const POSIX_FADV_NOREUSE: ::c_int = 5;

pub const POLLINIGNEOF: ::c_short = 0x2000;
pub const POLLRDHUP: ::c_short = 0x4000;

pub const EVFILT_READ: i16 = -1;
pub const EVFILT_WRITE: i16 = -2;
Expand Down Expand Up @@ -4742,6 +4743,14 @@ pub const CPU_WHICH_CPUSET: ::c_int = 3;
pub const CPU_WHICH_IRQ: ::c_int = 4;
pub const CPU_WHICH_JAIL: ::c_int = 5;

// net/route.h
pub const RTF_LLDATA: ::c_int = 0x400;
pub const RTF_FIXEDMTU: ::c_int = 0x80000;

pub const RTM_VERSION: ::c_int = 5;

pub const RTAX_MAX: ::c_int = 8;

// sys/signal.h
pub const SIGTHR: ::c_int = 32;
pub const SIGLWP: ::c_int = SIGTHR;
Expand Down
19 changes: 19 additions & 0 deletions src/unix/bsd/freebsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,25 @@ pub const SO_TYPE: ::c_int = 0x1008;

pub const LOCAL_PEERCRED: ::c_int = 1;

// net/route.h
pub const RTF_XRESOLVE: ::c_int = 0x200;
pub const RTF_LLINFO: ::c_int = 0x400;
pub const RTF_PROTO3: ::c_int = 0x40000;
pub const RTF_PINNED: ::c_int = 0x100000;
pub const RTF_LOCAL: ::c_int = 0x200000;
pub const RTF_BROADCAST: ::c_int = 0x400000;
pub const RTF_MULTICAST: ::c_int = 0x800000;

pub const RTM_LOCK: ::c_int = 0x8;
pub const RTM_RESOLVE: ::c_int = 0xb;
pub const RTM_NEWADDR: ::c_int = 0xc;
pub const RTM_DELADDR: ::c_int = 0xd;
pub const RTM_IFINFO: ::c_int = 0xe;
pub const RTM_NEWMADDR: ::c_int = 0xf;
pub const RTM_DELMADDR: ::c_int = 0x10;
pub const RTM_IFANNOUNCE: ::c_int = 0x11;
pub const RTM_IEEE80211: ::c_int = 0x12;

pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
pub const SHUT_RDWR: ::c_int = 2;
Expand Down
43 changes: 43 additions & 0 deletions src/unix/bsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,49 @@ pub const ITIMER_REAL: ::c_int = 0;
pub const ITIMER_VIRTUAL: ::c_int = 1;
pub const ITIMER_PROF: ::c_int = 2;

// net/route.h

pub const RTF_UP: ::c_int = 0x1;
pub const RTF_GATEWAY: ::c_int = 0x2;
pub const RTF_HOST: ::c_int = 0x4;
pub const RTF_REJECT: ::c_int = 0x8;
pub const RTF_DYNAMIC: ::c_int = 0x10;
pub const RTF_MODIFIED: ::c_int = 0x20;
pub const RTF_DONE: ::c_int = 0x40;
pub const RTF_STATIC: ::c_int = 0x800;
pub const RTF_BLACKHOLE: ::c_int = 0x1000;
pub const RTF_PROTO2: ::c_int = 0x4000;
pub const RTF_PROTO1: ::c_int = 0x8000;

// Message types
pub const RTM_ADD: ::c_int = 0x1;
pub const RTM_DELETE: ::c_int = 0x2;
pub const RTM_CHANGE: ::c_int = 0x3;
pub const RTM_GET: ::c_int = 0x4;
pub const RTM_LOSING: ::c_int = 0x5;
pub const RTM_REDIRECT: ::c_int = 0x6;
pub const RTM_MISS: ::c_int = 0x7;

// Bitmask values for rtm_addrs.
pub const RTA_DST: ::c_int = 0x1;
pub const RTA_GATEWAY: ::c_int = 0x2;
pub const RTA_NETMASK: ::c_int = 0x4;
pub const RTA_GENMASK: ::c_int = 0x8;
pub const RTA_IFP: ::c_int = 0x10;
pub const RTA_IFA: ::c_int = 0x20;
pub const RTA_AUTHOR: ::c_int = 0x40;
pub const RTA_BRD: ::c_int = 0x80;

// Index offsets for sockaddr array for alternate internal encoding.
pub const RTAX_DST: ::c_int = 0;
pub const RTAX_GATEWAY: ::c_int = 1;
pub const RTAX_NETMASK: ::c_int = 2;
pub const RTAX_GENMASK: ::c_int = 3;
pub const RTAX_IFP: ::c_int = 4;
pub const RTAX_IFA: ::c_int = 5;
pub const RTAX_AUTHOR: ::c_int = 6;
pub const RTAX_BRD: ::c_int = 7;

f! {
pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr {
if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() {
Expand Down
Loading

0 comments on commit 31f746a

Please sign in to comment.