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

[0.2] Backport four pull requests #3871

Merged
merged 4 commits into from
Aug 29, 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
8 changes: 8 additions & 0 deletions libc-test/semver/android.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1503,11 +1503,16 @@ NFT_CMP_LT
NFT_CMP_LTE
NFT_CMP_NEQ
NFT_CONTINUE
NFT_CT_AVGPKT
NFT_CT_BYTES
NFT_CT_DIRECTION
NFT_CT_DST
NFT_CT_DST_IP
NFT_CT_DST_IP6
NFT_CT_EVENTMASK
NFT_CT_EXPIRATION
NFT_CT_HELPER
NFT_CT_ID
NFT_CT_L3PROTOCOL
NFT_CT_LABELS
NFT_CT_MARK
Expand All @@ -1517,8 +1522,11 @@ NFT_CT_PROTO_DST
NFT_CT_PROTO_SRC
NFT_CT_SECMARK
NFT_CT_SRC
NFT_CT_SRC_IP
NFT_CT_SRC_IP6
NFT_CT_STATE
NFT_CT_STATUS
NFT_CT_ZONE
NFT_DATA_RESERVED_MASK
NFT_DATA_VALUE
NFT_DATA_VALUE_MAXLEN
Expand Down
8 changes: 8 additions & 0 deletions libc-test/semver/linux-gnu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,13 @@ NFT_CMP_LT
NFT_CMP_LTE
NFT_CMP_NEQ
NFT_CONTINUE
NFT_CT_AVGPKT
NFT_CT_BYTES
NFT_CT_DIRECTION
NFT_CT_DST
NFT_CT_DST_IP
NFT_CT_DST_IP6
NFT_CT_EVENTMASK
NFT_CT_EXPIRATION
NFT_CT_HELPER
NFT_CT_L3PROTOCOL
Expand All @@ -205,8 +209,11 @@ NFT_CT_PROTO_DST
NFT_CT_PROTO_SRC
NFT_CT_SECMARK
NFT_CT_SRC
NFT_CT_SRC_IP
NFT_CT_SRC_IP6
NFT_CT_STATE
NFT_CT_STATUS
NFT_CT_ZONE
NFT_DATA_RESERVED_MASK
NFT_DATA_VALUE
NFT_DATA_VALUE_MAXLEN
Expand Down Expand Up @@ -650,6 +657,7 @@ malloc_info
malloc_trim
malloc_usable_size
mallopt
mq_notify
nl_mmap_hdr
nl_mmap_req
nl_pktinfo
Expand Down
4 changes: 4 additions & 0 deletions libc-test/semver/unix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ IF_NAMESIZE
IGNBRK
IGNCR
IGNPAR
IN6ADDR_ANY_INIT
IN6ADDR_LOOPBACK_INIT
INADDR_ANY
INADDR_BROADCAST
INADDR_LOOPBACK
Expand Down Expand Up @@ -586,6 +588,8 @@ hstrerror
if_indextoname
if_nametoindex
in6_addr
in6addr_any
in6addr_loopback
in_addr
in_addr_t
in_port_t
Expand Down
8 changes: 8 additions & 0 deletions src/unix/align.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ s! {
pub s6_addr: [u8; 16],
}
}

pub const IN6ADDR_LOOPBACK_INIT: in6_addr = in6_addr {
s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
};

pub const IN6ADDR_ANY_INIT: in6_addr = in6_addr {
s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
};
5 changes: 5 additions & 0 deletions src/unix/hurd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,11 @@ s! {
pub tv_nsec: __syscall_slong_t,
}

pub struct __timeval {
pub tv_sec: i32,
pub tv_usec: i32,
}

pub struct __locale_data {
pub _address: u8,
}
Expand Down
8 changes: 8 additions & 0 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2572,6 +2572,14 @@ pub const NFT_CT_PROTO_DST: ::c_int = 12;
pub const NFT_CT_LABELS: ::c_int = 13;
pub const NFT_CT_PKTS: ::c_int = 14;
pub const NFT_CT_BYTES: ::c_int = 15;
pub const NFT_CT_AVGPKT: ::c_int = 16;
pub const NFT_CT_ZONE: ::c_int = 17;
pub const NFT_CT_EVENTMASK: ::c_int = 18;
pub const NFT_CT_SRC_IP: ::c_int = 19;
pub const NFT_CT_DST_IP: ::c_int = 20;
pub const NFT_CT_SRC_IP6: ::c_int = 21;
pub const NFT_CT_DST_IP6: ::c_int = 22;
pub const NFT_CT_ID: ::c_int = 23;

pub const NFT_LIMIT_PKTS: ::c_int = 0;
pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1;
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,8 @@ extern "C" {

// Added in `glibc` 2.34
pub fn close_range(first: ::c_uint, last: ::c_uint, flags: ::c_int) -> ::c_int;

pub fn mq_notify(mqdes: ::mqd_t, sevp: *const ::sigevent) -> ::c_int;
}

cfg_if! {
Expand Down
7 changes: 7 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3980,6 +3980,13 @@ pub const NFT_CT_PROTO_DST: ::c_int = 12;
pub const NFT_CT_LABELS: ::c_int = 13;
pub const NFT_CT_PKTS: ::c_int = 14;
pub const NFT_CT_BYTES: ::c_int = 15;
pub const NFT_CT_AVGPKT: ::c_int = 16;
pub const NFT_CT_ZONE: ::c_int = 17;
pub const NFT_CT_EVENTMASK: ::c_int = 18;
pub const NFT_CT_SRC_IP: ::c_int = 19;
pub const NFT_CT_DST_IP: ::c_int = 20;
pub const NFT_CT_SRC_IP6: ::c_int = 21;
pub const NFT_CT_DST_IP6: ::c_int = 22;

pub const NFT_LIMIT_PKTS: ::c_int = 0;
pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1;
Expand Down
5 changes: 5 additions & 0 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ pub const ATF_PERM: ::c_int = 0x04;
pub const ATF_PUBL: ::c_int = 0x08;
pub const ATF_USETRAILERS: ::c_int = 0x10;

extern "C" {
pub static in6addr_loopback: in6_addr;
pub static in6addr_any: in6_addr;
}

cfg_if! {
if #[cfg(any(target_os = "l4re", target_os = "espidf"))] {
// required libraries for L4Re and the ESP-IDF framework are linked externally, ATM
Expand Down
10 changes: 10 additions & 0 deletions src/unix/no_align.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ s! {
__align: [u32; 0],
}
}

pub const IN6ADDR_LOOPBACK_INIT: in6_addr = in6_addr {
s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
__align: [0u32; 0],
};

pub const IN6ADDR_ANY_INIT: in6_addr = in6_addr {
s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
__align: [0u32; 0],
};