🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

libc

Package Overview
Dependencies
Maintainers
0
Versions
202
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libc - cargo Package Compare versions

Comparing version
0.2.179
to
0.2.180
+20
src/new/linux_uapi/linux/membarrier.rs
//! Header: `uapi/linux/membarrier.h`
use crate::prelude::*;
c_enum! {
// FIXME(1.0): incorrect repr signedness, this should be removed in a breaking change.
#[repr(c_int)]
pub enum membarrier_cmd {
pub MEMBARRIER_CMD_QUERY = 0,
pub MEMBARRIER_CMD_GLOBAL = 1 << 0,
pub MEMBARRIER_CMD_GLOBAL_EXPEDITED = 1 << 1,
pub MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED = 1 << 2,
pub MEMBARRIER_CMD_PRIVATE_EXPEDITED = 1 << 3,
pub MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED = 1 << 4,
pub MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE = 1 << 5,
pub MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE = 1 << 6,
pub MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ = 1 << 7,
pub MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ = 1 << 8,
}
}
//! Header: `uapi/linux/netlink.h`
use crate::prelude::*;
pub const NETLINK_ROUTE: c_int = 0;
pub const NETLINK_UNUSED: c_int = 1;
pub const NETLINK_USERSOCK: c_int = 2;
pub const NETLINK_FIREWALL: c_int = 3;
pub const NETLINK_SOCK_DIAG: c_int = 4;
pub const NETLINK_NFLOG: c_int = 5;
pub const NETLINK_XFRM: c_int = 6;
pub const NETLINK_SELINUX: c_int = 7;
pub const NETLINK_ISCSI: c_int = 8;
pub const NETLINK_AUDIT: c_int = 9;
pub const NETLINK_FIB_LOOKUP: c_int = 10;
pub const NETLINK_CONNECTOR: c_int = 11;
pub const NETLINK_NETFILTER: c_int = 12;
pub const NETLINK_IP6_FW: c_int = 13;
pub const NETLINK_DNRTMSG: c_int = 14;
pub const NETLINK_KOBJECT_UEVENT: c_int = 15;
pub const NETLINK_GENERIC: c_int = 16;
pub const NETLINK_SCSITRANSPORT: c_int = 18;
pub const NETLINK_ECRYPTFS: c_int = 19;
pub const NETLINK_RDMA: c_int = 20;
pub const NETLINK_CRYPTO: c_int = 21;
pub const NETLINK_INET_DIAG: c_int = NETLINK_SOCK_DIAG;
pub const MAX_LINKS: c_int = 32;
s! {
pub struct sockaddr_nl {
pub nl_family: crate::sa_family_t,
nl_pad: Padding<c_ushort>,
pub nl_pid: u32,
pub nl_groups: u32,
}
pub struct nlmsghdr {
pub nlmsg_len: u32,
pub nlmsg_type: u16,
pub nlmsg_flags: u16,
pub nlmsg_seq: u32,
pub nlmsg_pid: u32,
}
}
pub const NLM_F_REQUEST: c_int = 1;
pub const NLM_F_MULTI: c_int = 2;
pub const NLM_F_ACK: c_int = 4;
pub const NLM_F_ECHO: c_int = 8;
pub const NLM_F_DUMP_INTR: c_int = 16;
pub const NLM_F_DUMP_FILTERED: c_int = 32;
pub const NLM_F_ROOT: c_int = 0x100;
pub const NLM_F_MATCH: c_int = 0x200;
pub const NLM_F_ATOMIC: c_int = 0x400;
pub const NLM_F_DUMP: c_int = NLM_F_ROOT | NLM_F_MATCH;
pub const NLM_F_REPLACE: c_int = 0x100;
pub const NLM_F_EXCL: c_int = 0x200;
pub const NLM_F_CREATE: c_int = 0x400;
pub const NLM_F_APPEND: c_int = 0x800;
pub const NLM_F_NONREC: c_int = 0x100;
pub const NLM_F_CAPPED: c_int = 0x100;
pub const NLM_F_ACK_TLVS: c_int = 0x200;
pub const NLMSG_NOOP: c_int = 0x1;
pub const NLMSG_ERROR: c_int = 0x2;
pub const NLMSG_DONE: c_int = 0x3;
pub const NLMSG_OVERRUN: c_int = 0x4;
pub const NLMSG_MIN_TYPE: c_int = 0x10;
s! {
pub struct nlmsgerr {
pub error: c_int,
pub msg: nlmsghdr,
}
}
pub const NETLINK_ADD_MEMBERSHIP: c_int = 1;
pub const NETLINK_DROP_MEMBERSHIP: c_int = 2;
pub const NETLINK_PKTINFO: c_int = 3;
pub const NETLINK_BROADCAST_ERROR: c_int = 4;
pub const NETLINK_NO_ENOBUFS: c_int = 5;
pub const NETLINK_RX_RING: c_int = 6;
pub const NETLINK_TX_RING: c_int = 7;
pub const NETLINK_LISTEN_ALL_NSID: c_int = 8;
pub const NETLINK_LIST_MEMBERSHIPS: c_int = 9;
pub const NETLINK_CAP_ACK: c_int = 10;
pub const NETLINK_EXT_ACK: c_int = 11;
pub const NETLINK_GET_STRICT_CHK: c_int = 12;
s! {
pub struct nl_pktinfo {
pub group: u32,
}
pub struct nl_mmap_req {
pub nm_block_size: c_uint,
pub nm_block_nr: c_uint,
pub nm_frame_size: c_uint,
pub nm_frame_nr: c_uint,
}
pub struct nl_mmap_hdr {
pub nm_status: c_uint,
pub nm_len: c_uint,
pub nm_group: u32,
pub nm_pid: u32,
pub nm_uid: u32,
pub nm_gid: u32,
}
}
s! {
pub struct nlattr {
pub nla_len: u16,
pub nla_type: u16,
}
}
pub const NLA_F_NESTED: c_int = 1 << 15;
pub const NLA_F_NET_BYTEORDER: c_int = 1 << 14;
pub const NLA_TYPE_MASK: c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);
pub const NLA_ALIGNTO: c_int = 4;
f! {
pub fn NLA_ALIGN(len: c_int) -> c_int {
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1);
}
}
use crate::bpf_insn;
pub const BPF_LD: u16 = 0x00;
pub const BPF_LDX: u16 = 0x01;
pub const BPF_ST: u16 = 0x02;
pub const BPF_STX: u16 = 0x03;
pub const BPF_ALU: u16 = 0x04;
pub const BPF_JMP: u16 = 0x05;
pub const BPF_RET: u16 = 0x06;
pub const BPF_MISC: u16 = 0x07;
pub const BPF_W: u16 = 0x00;
pub const BPF_H: u16 = 0x08;
pub const BPF_B: u16 = 0x10;
pub const BPF_IMM: u16 = 0x00;
pub const BPF_ABS: u16 = 0x20;
pub const BPF_IND: u16 = 0x40;
pub const BPF_MEM: u16 = 0x60;
pub const BPF_LEN: u16 = 0x80;
pub const BPF_MSH: u16 = 0xa0;
pub const BPF_ADD: u16 = 0x00;
pub const BPF_SUB: u16 = 0x10;
pub const BPF_MUL: u16 = 0x20;
pub const BPF_DIV: u16 = 0x30;
pub const BPF_OR: u16 = 0x40;
pub const BPF_AND: u16 = 0x50;
pub const BPF_LSH: u16 = 0x60;
pub const BPF_RSH: u16 = 0x70;
pub const BPF_NEG: u16 = 0x80;
pub const BPF_MOD: u16 = 0x90;
pub const BPF_XOR: u16 = 0xa0;
pub const BPF_JA: u16 = 0x00;
pub const BPF_JEQ: u16 = 0x10;
pub const BPF_JGT: u16 = 0x20;
pub const BPF_JGE: u16 = 0x30;
pub const BPF_JSET: u16 = 0x40;
pub const BPF_K: u16 = 0x00;
pub const BPF_X: u16 = 0x08;
pub const BPF_A: u16 = 0x10;
pub const BPF_TAX: u16 = 0x00;
pub const BPF_TXA: u16 = 0x80;
f! {
pub fn BPF_CLASS(code: u32) -> u32 {
code & 0x07
}
pub fn BPF_SIZE(code: u32) -> u32 {
code & 0x18
}
pub fn BPF_MODE(code: u32) -> u32 {
code & 0xe0
}
pub fn BPF_OP(code: u32) -> u32 {
code & 0xf0
}
pub fn BPF_SRC(code: u32) -> u32 {
code & 0x08
}
pub fn BPF_RVAL(code: u32) -> u32 {
code & 0x18
}
pub fn BPF_MISCOP(code: u32) -> u32 {
code & 0xf8
}
pub fn BPF_STMT(code: u16, k: u32) -> bpf_insn {
bpf_insn {
code,
jt: 0,
jf: 0,
k,
}
}
pub fn BPF_JUMP(code: u16, k: u32, jt: u8, jf: u8) -> bpf_insn {
bpf_insn { code, jt, jf, k }
}
}
use crate::prelude::*;
s_no_extra_traits! {
pub union __c_anonymous_ifr_ifru {
pub ifru_addr: crate::sockaddr,
pub ifru_dstaddr: crate::sockaddr,
pub ifru_broadaddr: crate::sockaddr,
pub ifru_buffer: ifreq_buffer,
pub ifru_flags: [c_short; 2],
pub ifru_index: c_short,
pub ifru_jid: c_int,
pub ifru_metric: c_int,
pub ifru_mtu: c_int,
pub ifru_phys: c_int,
pub ifru_media: c_int,
pub ifru_data: *mut c_char,
pub ifru_cap: [c_int; 2],
pub ifru_fib: c_uint,
pub ifru_vlan_pcp: c_uchar,
}
pub struct ifreq {
/// if name, e.g. "en0"
pub ifr_name: [c_char; crate::IFNAMSIZ],
pub ifr_ifru: __c_anonymous_ifr_ifru,
}
pub struct ifreq_buffer {
pub length: size_t,
pub buffer: *mut c_void,
}
}
+1
-1
{
"git": {
"sha1": "4c61c9c78c7463ee0498ac96b11cdbcf8111d113"
"sha1": "4b38c69e31afadbead63af49794850b5a41f7dc4"
},
"path_in_vcs": ""
}

@@ -7,3 +7,3 @@ # This file is automatically @generated by Cargo.

name = "libc"
version = "0.2.179"
version = "0.2.180"
dependencies = [

@@ -10,0 +10,0 @@ "rustc-std-workspace-core",

@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO

name = "libc"
version = "0.2.179"
version = "0.2.180"
authors = ["The Rust Project Developers"]

@@ -19,0 +19,0 @@ build = "build.rs"

# Changelog
## [0.2.178](https://github.com/rust-lang/libc/compare/0.2.177...0.2.178) - 2025-12-01
## [0.2.180](https://github.com/rust-lang/libc/compare/0.2.179...0.2.180) - 2026-01-08
### Added
- QNX: Add missing BPF and ifreq structures ([#4769](https://github.com/rust-lang/libc/pull/4769))
### Fixed
- Linux, L4Re: address soundness issues of `CMSG_NXTHDR` ([#4903](https://github.com/rust-lang/libc/pull/4903))
- Linux-like: Handle zero-sized payload differences in `CMSG_NXTHDR` ([#4903](https://github.com/rust-lang/libc/pull/4903))
- Musl: Fix incorrect definitions of struct stat on some 32-bit architectures ([#4914](https://github.com/rust-lang/libc/pull/4914))
- NetBSD: RISC-V 64: Correct `mcontext` type definitions ([#4886](https://github.com/rust-lang/libc/pull/4886))
- uClibc: Re-enable `__SIZEOF_PTHREAD_COND_T` on non-L4Re uclibc ([#4915](https://github.com/rust-lang/libc/pull/4915))
- uClibc: Restructure Linux `netlink` module to resolve build errors ([#4915](https://github.com/rust-lang/libc/pull/4915))
## [0.2.179](https://github.com/rust-lang/libc/compare/0.2.178...0.2.179) - 2025-01-03
With this release, we now have _unstable_ support for 64-bit `time_t` on 32-bit

@@ -6,0 +22,0 @@ platforms with both Musl and Glibc. Testing is appreciated!

@@ -7,1 +7,3 @@ //! Directory: `linux/`

pub(crate) mod keyctl;
pub(crate) mod membarrier;
pub(crate) mod netlink;

@@ -113,3 +113,3 @@ //! This module contains the future directory structure. If possible, new definitions should

mod rtems;
pub(crate) use rtems::*;
// pub(crate) use rtems::*;
} else if #[cfg(target_os = "solaris")] {

@@ -185,2 +185,4 @@ mod solaris;

pub use linux::keyctl::*;
pub use linux::membarrier::*;
pub use linux::netlink::*;
#[cfg(target_env = "gnu")]

@@ -206,2 +208,5 @@ pub use net::route::*;

pub use sys::ipc::*;
} else if #[cfg(target_os = "nto")] {
pub use net::bpf::*;
pub use net::if_::*;
}

@@ -208,0 +213,0 @@ }

@@ -5,1 +5,6 @@ //! QNX Neutrino libc.

pub(crate) mod unistd;
pub(crate) mod net {
pub(crate) mod bpf;
pub(crate) mod if_;
}

@@ -5,14 +5,6 @@ use crate::prelude::*;

pub type __greg_t = u64;
pub type __cpu_simple_lock_nv_t = c_int;
pub type __gregset = [__greg_t; _NGREG];
pub type __fregset = [__fpreg; _NFREG];
pub type __cpu_simple_lock_nv_t = c_uint;
pub type __gregset_t = [__greg_t; _NGREG];
pub type __fregset_t = [__fpreg; _NFREG];
s! {
pub struct mcontext_t {
pub __gregs: __gregset,
pub __fregs: __fregset,
__spare: [crate::__greg_t; 7],
}
}
s_no_extra_traits! {

@@ -25,7 +17,15 @@ pub union __fpreg {

s! {
pub struct mcontext_t {
pub __gregs: __gregset_t,
pub __fregs: __fregset_t,
__spare: [crate::__greg_t; 7],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for __fpreg {
fn eq(&self, other: &Self) -> bool {
unsafe { self.u_u64 == other.u_u64 }
fn eq(&self, other: &__fpreg) -> bool {
unsafe { self.u_u64 == other.u_u64 || self.u_d == other.u_d }
}

@@ -36,3 +36,5 @@ }

fn hash<H: hash::Hasher>(&self, state: &mut H) {
unsafe { self.u_u64.hash(state) };
unsafe {
self.u_u64.hash(state);
}
}

@@ -43,3 +45,6 @@ }

pub(crate) const _ALIGNBYTES: usize = size_of::<c_long>() - 1;
// gcc for riscv64 defines `BIGGEST_ALIGNMENT`, but it's mesured in bits.
pub(crate) const __BIGGEST_ALIGNMENT_IN_BITS__: usize = 128;
// `_ALIGNBYTES` is measured in, well, bytes.
pub(crate) const _ALIGNBYTES: usize = (__BIGGEST_ALIGNMENT_IN_BITS__ / 8) - 1;

@@ -46,0 +51,0 @@ pub const PT_GETREGS: c_int = PT_FIRSTMACH + 0;

@@ -1260,3 +1260,3 @@ use crate::prelude::*;

let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize;
if (next.offset(1)) as usize > max {
if (next.offset(1)) as usize >= max {
core::ptr::null_mut::<cmsghdr>()

@@ -1263,0 +1263,0 @@ } else {

@@ -190,2 +190,12 @@ ///! L4Re specifics

cfg_if! {
if #[cfg(not(target_env = "uclibc"))] {
pub const NLMSG_NOOP: c_int = 0x1;
pub const NLMSG_ERROR: c_int = 0x2;
pub const NLMSG_DONE: c_int = 0x3;
pub const NLMSG_OVERRUN: c_int = 0x4;
pub const NLMSG_MIN_TYPE: c_int = 0x10;
}
}
cfg_if! {
if #[cfg(target_env = "uclibc")] {

@@ -192,0 +202,0 @@ mod uclibc;

@@ -136,22 +136,2 @@ use crate::off64_t;

pub struct nl_pktinfo {
pub group: u32,
}
pub struct nl_mmap_req {
pub nm_block_size: c_uint,
pub nm_block_nr: c_uint,
pub nm_frame_size: c_uint,
pub nm_frame_nr: c_uint,
}
pub struct nl_mmap_hdr {
pub nm_status: c_uint,
pub nm_len: c_uint,
pub nm_group: u32,
pub nm_pid: u32,
pub nm_uid: u32,
pub nm_gid: u32,
}
pub struct ntptimeval {

@@ -814,4 +794,2 @@ pub time: crate::timeval,

pub const MAX_LINKS: c_int = 32;
pub const GENL_UNS_ADMIN_PERM: c_int = 0x10;

@@ -818,0 +796,0 @@

@@ -30,8 +30,14 @@ use crate::off_t;

#[cfg(not(musl32_time64))]
pub st_atim: crate::timespec,
#[cfg(not(musl32_time64))]
pub st_mtim: crate::timespec,
#[cfg(not(musl32_time64))]
pub st_ctim: crate::timespec,
#[cfg(not(musl_v1_2_3))]
pub st_atime: crate::time_t,
#[cfg(not(musl_v1_2_3))]
pub st_atime_nsec: c_long,
#[cfg(not(musl_v1_2_3))]
pub st_mtime: crate::time_t,
#[cfg(not(musl_v1_2_3))]
pub st_mtime_nsec: c_long,
#[cfg(not(musl_v1_2_3))]
pub st_ctime: crate::time_t,
#[cfg(not(musl_v1_2_3))]
pub st_ctime_nsec: c_long,

@@ -38,0 +44,0 @@ pub st_ino: crate::ino_t,

@@ -28,8 +28,14 @@ use crate::off_t;

#[cfg(not(musl32_time64))]
pub st_atim: crate::timespec,
#[cfg(not(musl32_time64))]
pub st_mtim: crate::timespec,
#[cfg(not(musl32_time64))]
pub st_ctim: crate::timespec,
#[cfg(not(musl_v1_2_3))]
pub st_atime: crate::time_t,
#[cfg(not(musl_v1_2_3))]
pub st_atime_nsec: c_long,
#[cfg(not(musl_v1_2_3))]
pub st_mtime: crate::time_t,
#[cfg(not(musl_v1_2_3))]
pub st_mtime_nsec: c_long,
#[cfg(not(musl_v1_2_3))]
pub st_ctime: crate::time_t,
#[cfg(not(musl_v1_2_3))]
pub st_ctime_nsec: c_long,

@@ -36,0 +42,0 @@ pub st_blksize: crate::blksize_t,

@@ -40,8 +40,14 @@ use crate::off_t;

#[cfg(not(musl32_time64))]
pub st_atim: crate::timespec,
#[cfg(not(musl32_time64))]
pub st_mtim: crate::timespec,
#[cfg(not(musl32_time64))]
pub st_ctim: crate::timespec,
#[cfg(not(musl_v1_2_3))]
pub st_atime: crate::time_t,
#[cfg(not(musl_v1_2_3))]
pub st_atime_nsec: c_long,
#[cfg(not(musl_v1_2_3))]
pub st_mtime: crate::time_t,
#[cfg(not(musl_v1_2_3))]
pub st_mtime_nsec: c_long,
#[cfg(not(musl_v1_2_3))]
pub st_ctime: crate::time_t,
#[cfg(not(musl_v1_2_3))]
pub st_ctime_nsec: c_long,

@@ -48,0 +54,0 @@ __unused: Padding<[c_long; 2]>,

@@ -30,8 +30,14 @@ use crate::off_t;

#[cfg(not(musl32_time64))]
pub st_atim: crate::timespec,
#[cfg(not(musl32_time64))]
pub st_mtim: crate::timespec,
#[cfg(not(musl32_time64))]
pub st_ctim: crate::timespec,
#[cfg(not(musl_v1_2_3))]
pub st_atime: crate::time_t,
#[cfg(not(musl_v1_2_3))]
pub st_atime_nsec: c_long,
#[cfg(not(musl_v1_2_3))]
pub st_mtime: crate::time_t,
#[cfg(not(musl_v1_2_3))]
pub st_mtime_nsec: c_long,
#[cfg(not(musl_v1_2_3))]
pub st_ctime: crate::time_t,
#[cfg(not(musl_v1_2_3))]
pub st_ctime_nsec: c_long,

@@ -38,0 +44,0 @@ pub st_ino: crate::ino_t,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display