aboutsummaryrefslogtreecommitdiff
path: root/libc/src/unix/notbsd/linux/other/mod.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2018-12-10 21:00:27 -0800
committerDaniel Mueller <deso@posteo.net>2018-12-10 21:00:27 -0800
commite2604a756aaddcd5919ee2f1b9cc0055d200f846 (patch)
tree1ea1b9900db20d3aadbddbce18882d0c957247d7 /libc/src/unix/notbsd/linux/other/mod.rs
parent5875df6c958743cf86c75b2cb5fc2efe5ca0de43 (diff)
downloadnitrocli-e2604a756aaddcd5919ee2f1b9cc0055d200f846.tar.gz
nitrocli-e2604a756aaddcd5919ee2f1b9cc0055d200f846.tar.bz2
Update libc crate to 0.2.45
This change updates the libc crate to version 0.2.45. Import subrepo libc/:libc at f5636fc618f8e16968b3178196d73c94ad9f7b05
Diffstat (limited to 'libc/src/unix/notbsd/linux/other/mod.rs')
-rw-r--r--libc/src/unix/notbsd/linux/other/mod.rs338
1 files changed, 331 insertions, 7 deletions
diff --git a/libc/src/unix/notbsd/linux/other/mod.rs b/libc/src/unix/notbsd/linux/other/mod.rs
index c256d5f..c1e3393 100644
--- a/libc/src/unix/notbsd/linux/other/mod.rs
+++ b/libc/src/unix/notbsd/linux/other/mod.rs
@@ -158,13 +158,90 @@ s! {
}
// FIXME this is actually a union
+ #[cfg_attr(all(feature = "align", target_pointer_width = "32"),
+ repr(align(4)))]
+ #[cfg_attr(all(feature = "align", target_pointer_width = "64"),
+ repr(align(8)))]
pub struct sem_t {
#[cfg(target_pointer_width = "32")]
__size: [::c_char; 16],
#[cfg(target_pointer_width = "64")]
__size: [::c_char; 32],
+ #[cfg(not(feature = "align"))]
__align: [::c_long; 0],
}
+
+ pub struct mallinfo {
+ pub arena: ::c_int,
+ pub ordblks: ::c_int,
+ pub smblks: ::c_int,
+ pub hblks: ::c_int,
+ pub hblkhd: ::c_int,
+ pub usmblks: ::c_int,
+ pub fsmblks: ::c_int,
+ pub uordblks: ::c_int,
+ pub fordblks: ::c_int,
+ pub keepcost: ::c_int,
+ }
+
+ pub struct nlmsghdr {
+ pub nlmsg_len: u32,
+ pub nlmsg_type: u16,
+ pub nlmsg_flags: u16,
+ pub nlmsg_seq: u32,
+ pub nlmsg_pid: u32,
+ }
+
+ pub struct nlmsgerr {
+ pub error: ::c_int,
+ pub msg: nlmsghdr,
+ }
+
+ 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 nlattr {
+ pub nla_len: u16,
+ pub nla_type: u16,
+ }
+
+ pub struct rtentry {
+ pub rt_pad1: ::c_ulong,
+ pub rt_dst: ::sockaddr,
+ pub rt_gateway: ::sockaddr,
+ pub rt_genmask: ::sockaddr,
+ pub rt_flags: ::c_ushort,
+ pub rt_pad2: ::c_short,
+ pub rt_pad3: ::c_ulong,
+ pub rt_tos: ::c_uchar,
+ pub rt_class: ::c_uchar,
+ #[cfg(target_pointer_width = "64")]
+ pub rt_pad4: [::c_short; 3usize],
+ #[cfg(not(target_pointer_width = "64"))]
+ pub rt_pad4: ::c_short,
+ pub rt_metric: ::c_short,
+ pub rt_dev: *mut ::c_char,
+ pub rt_mtu: ::c_ulong,
+ pub rt_window: ::c_ulong,
+ pub rt_irtt: ::c_ushort,
+ }
}
pub const __UT_LINESIZE: usize = 32;
@@ -192,13 +269,13 @@ pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
pub const SOL_RXRPC: ::c_int = 272;
pub const SOL_PPPOL2TP: ::c_int = 273;
-pub const SOL_BLUETOOTH: ::c_int = 274;
pub const SOL_PNPIPE: ::c_int = 275;
pub const SOL_RDS: ::c_int = 276;
pub const SOL_IUCV: ::c_int = 277;
pub const SOL_CAIF: ::c_int = 278;
pub const SOL_ALG: ::c_int = 279;
pub const SOL_NFC: ::c_int = 280;
+pub const SOL_XDP: ::c_int = 283;
pub const MSG_TRYHARD: ::c_int = 4;
@@ -504,12 +581,6 @@ 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 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;
-
pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1;
pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2;
pub const NETLINK_PKTINFO: ::c_int = 3;
@@ -525,6 +596,13 @@ 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;
+
+pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10;
+
+pub const GENL_ID_VFS_DQUOT: ::c_int = ::NLMSG_MIN_TYPE + 1;
+pub const GENL_ID_PMCRAID: ::c_int = ::NLMSG_MIN_TYPE + 2;
+
pub const TIOCM_LE: ::c_int = 0x001;
pub const TIOCM_DTR: ::c_int = 0x002;
pub const TIOCM_RTS: ::c_int = 0x004;
@@ -537,6 +615,228 @@ pub const TIOCM_DSR: ::c_int = 0x100;
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
+pub const NF_NETDEV_INGRESS: ::c_int = 0;
+pub const NF_NETDEV_NUMHOOKS: ::c_int = 1;
+
+pub const NFPROTO_INET: ::c_int = 1;
+pub const NFPROTO_NETDEV: ::c_int = 5;
+
+// linux/netfilter/nf_tables.h
+cfg_if!{
+ if #[cfg(any(target_arch = "arm", target_arch = "powerpc",
+ target_arch = "powerpc64", target_arch = "aarch64"))] {
+ pub const NFT_TABLE_MAXNAMELEN: ::c_int = 32;
+ pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 32;
+ pub const NFT_SET_MAXNAMELEN: ::c_int = 32;
+ pub const NFT_OBJ_MAXNAMELEN: ::c_int = 32;
+ } else if #[cfg(target_arch = "sparc64")] {
+ pub const NFT_TABLE_MAXNAMELEN: ::c_int = 32;
+ pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 32;
+ pub const NFT_SET_MAXNAMELEN: ::c_int = 32;
+ } else {
+ pub const NFT_TABLE_MAXNAMELEN: ::c_int = 256;
+ pub const NFT_CHAIN_MAXNAMELEN: ::c_int = 256;
+ pub const NFT_SET_MAXNAMELEN: ::c_int = 256;
+ pub const NFT_OBJ_MAXNAMELEN: ::c_int = 256;
+ }
+}
+pub const NFT_USERDATA_MAXLEN: ::c_int = 256;
+
+pub const NFT_REG_VERDICT: ::c_int = 0;
+pub const NFT_REG_1: ::c_int = 1;
+pub const NFT_REG_2: ::c_int = 2;
+pub const NFT_REG_3: ::c_int = 3;
+pub const NFT_REG_4: ::c_int = 4;
+pub const __NFT_REG_MAX: ::c_int = 5;
+pub const NFT_REG32_00: ::c_int = 8;
+pub const NFT_REG32_01: ::c_int = 9;
+pub const NFT_REG32_02: ::c_int = 10;
+pub const NFT_REG32_03: ::c_int = 11;
+pub const NFT_REG32_04: ::c_int = 12;
+pub const NFT_REG32_05: ::c_int = 13;
+pub const NFT_REG32_06: ::c_int = 14;
+pub const NFT_REG32_07: ::c_int = 15;
+pub const NFT_REG32_08: ::c_int = 16;
+pub const NFT_REG32_09: ::c_int = 17;
+pub const NFT_REG32_10: ::c_int = 18;
+pub const NFT_REG32_11: ::c_int = 19;
+pub const NFT_REG32_12: ::c_int = 20;
+pub const NFT_REG32_13: ::c_int = 21;
+pub const NFT_REG32_14: ::c_int = 22;
+pub const NFT_REG32_15: ::c_int = 23;
+
+pub const NFT_REG_SIZE: ::c_int = 16;
+pub const NFT_REG32_SIZE: ::c_int = 4;
+
+pub const NFT_CONTINUE: ::c_int = -1;
+pub const NFT_BREAK: ::c_int = -2;
+pub const NFT_JUMP: ::c_int = -3;
+pub const NFT_GOTO: ::c_int = -4;
+pub const NFT_RETURN: ::c_int = -5;
+
+pub const NFT_MSG_NEWTABLE: ::c_int = 0;
+pub const NFT_MSG_GETTABLE: ::c_int = 1;
+pub const NFT_MSG_DELTABLE: ::c_int = 2;
+pub const NFT_MSG_NEWCHAIN: ::c_int = 3;
+pub const NFT_MSG_GETCHAIN: ::c_int = 4;
+pub const NFT_MSG_DELCHAIN: ::c_int = 5;
+pub const NFT_MSG_NEWRULE: ::c_int = 6;
+pub const NFT_MSG_GETRULE: ::c_int = 7;
+pub const NFT_MSG_DELRULE: ::c_int = 8;
+pub const NFT_MSG_NEWSET: ::c_int = 9;
+pub const NFT_MSG_GETSET: ::c_int = 10;
+pub const NFT_MSG_DELSET: ::c_int = 11;
+pub const NFT_MSG_NEWSETELEM: ::c_int = 12;
+pub const NFT_MSG_GETSETELEM: ::c_int = 13;
+pub const NFT_MSG_DELSETELEM: ::c_int = 14;
+pub const NFT_MSG_NEWGEN: ::c_int = 15;
+pub const NFT_MSG_GETGEN: ::c_int = 16;
+pub const NFT_MSG_TRACE: ::c_int = 17;
+cfg_if! {
+ if #[cfg(not(target_arch = "sparc64"))] {
+ pub const NFT_MSG_NEWOBJ: ::c_int = 18;
+ pub const NFT_MSG_GETOBJ: ::c_int = 19;
+ pub const NFT_MSG_DELOBJ: ::c_int = 20;
+ pub const NFT_MSG_GETOBJ_RESET: ::c_int = 21;
+ pub const NFT_MSG_MAX: ::c_int = 22;
+ } else {
+ pub const NFT_MSG_MAX: ::c_int = 18;
+ }
+}
+
+pub const NFT_SET_ANONYMOUS: ::c_int = 0x1;
+pub const NFT_SET_CONSTANT: ::c_int = 0x2;
+pub const NFT_SET_INTERVAL: ::c_int = 0x4;
+pub const NFT_SET_MAP: ::c_int = 0x8;
+pub const NFT_SET_TIMEOUT: ::c_int = 0x10;
+pub const NFT_SET_EVAL: ::c_int = 0x20;
+
+pub const NFT_SET_POL_PERFORMANCE: ::c_int = 0;
+pub const NFT_SET_POL_MEMORY: ::c_int = 1;
+
+pub const NFT_SET_ELEM_INTERVAL_END: ::c_int = 0x1;
+
+pub const NFT_DATA_VALUE: ::c_uint = 0;
+pub const NFT_DATA_VERDICT: ::c_uint = 0xffffff00;
+
+pub const NFT_DATA_RESERVED_MASK: ::c_uint = 0xffffff00;
+
+pub const NFT_DATA_VALUE_MAXLEN: ::c_int = 64;
+
+pub const NFT_BYTEORDER_NTOH: ::c_int = 0;
+pub const NFT_BYTEORDER_HTON: ::c_int = 1;
+
+pub const NFT_CMP_EQ: ::c_int = 0;
+pub const NFT_CMP_NEQ: ::c_int = 1;
+pub const NFT_CMP_LT: ::c_int = 2;
+pub const NFT_CMP_LTE: ::c_int = 3;
+pub const NFT_CMP_GT: ::c_int = 4;
+pub const NFT_CMP_GTE: ::c_int = 5;
+
+pub const NFT_RANGE_EQ: ::c_int = 0;
+pub const NFT_RANGE_NEQ: ::c_int = 1;
+
+pub const NFT_LOOKUP_F_INV: ::c_int = (1 << 0);
+
+pub const NFT_DYNSET_OP_ADD: ::c_int = 0;
+pub const NFT_DYNSET_OP_UPDATE: ::c_int = 1;
+
+pub const NFT_DYNSET_F_INV: ::c_int = (1 << 0);
+
+pub const NFT_PAYLOAD_LL_HEADER: ::c_int = 0;
+pub const NFT_PAYLOAD_NETWORK_HEADER: ::c_int = 1;
+pub const NFT_PAYLOAD_TRANSPORT_HEADER: ::c_int = 2;
+
+pub const NFT_PAYLOAD_CSUM_NONE: ::c_int = 0;
+pub const NFT_PAYLOAD_CSUM_INET: ::c_int = 1;
+
+pub const NFT_META_LEN: ::c_int = 0;
+pub const NFT_META_PROTOCOL: ::c_int = 1;
+pub const NFT_META_PRIORITY: ::c_int = 2;
+pub const NFT_META_MARK: ::c_int = 3;
+pub const NFT_META_IIF: ::c_int = 4;
+pub const NFT_META_OIF: ::c_int = 5;
+pub const NFT_META_IIFNAME: ::c_int = 6;
+pub const NFT_META_OIFNAME: ::c_int = 7;
+pub const NFT_META_IIFTYPE: ::c_int = 8;
+pub const NFT_META_OIFTYPE: ::c_int = 9;
+pub const NFT_META_SKUID: ::c_int = 10;
+pub const NFT_META_SKGID: ::c_int = 11;
+pub const NFT_META_NFTRACE: ::c_int = 12;
+pub const NFT_META_RTCLASSID: ::c_int = 13;
+pub const NFT_META_SECMARK: ::c_int = 14;
+pub const NFT_META_NFPROTO: ::c_int = 15;
+pub const NFT_META_L4PROTO: ::c_int = 16;
+pub const NFT_META_BRI_IIFNAME: ::c_int = 17;
+pub const NFT_META_BRI_OIFNAME: ::c_int = 18;
+pub const NFT_META_PKTTYPE: ::c_int = 19;
+pub const NFT_META_CPU: ::c_int = 20;
+pub const NFT_META_IIFGROUP: ::c_int = 21;
+pub const NFT_META_OIFGROUP: ::c_int = 22;
+pub const NFT_META_CGROUP: ::c_int = 23;
+pub const NFT_META_PRANDOM: ::c_int = 24;
+
+pub const NFT_CT_STATE: ::c_int = 0;
+pub const NFT_CT_DIRECTION: ::c_int = 1;
+pub const NFT_CT_STATUS: ::c_int = 2;
+pub const NFT_CT_MARK: ::c_int = 3;
+pub const NFT_CT_SECMARK: ::c_int = 4;
+pub const NFT_CT_EXPIRATION: ::c_int = 5;
+pub const NFT_CT_HELPER: ::c_int = 6;
+pub const NFT_CT_L3PROTOCOL: ::c_int = 7;
+pub const NFT_CT_SRC: ::c_int = 8;
+pub const NFT_CT_DST: ::c_int = 9;
+pub const NFT_CT_PROTOCOL: ::c_int = 10;
+pub const NFT_CT_PROTO_SRC: ::c_int = 11;
+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_LIMIT_PKTS: ::c_int = 0;
+pub const NFT_LIMIT_PKT_BYTES: ::c_int = 1;
+
+pub const NFT_LIMIT_F_INV: ::c_int = (1 << 0);
+
+pub const NFT_QUEUE_FLAG_BYPASS: ::c_int = 0x01;
+pub const NFT_QUEUE_FLAG_CPU_FANOUT: ::c_int = 0x02;
+pub const NFT_QUEUE_FLAG_MASK: ::c_int = 0x03;
+
+pub const NFT_QUOTA_F_INV: ::c_int = (1 << 0);
+
+pub const NFT_REJECT_ICMP_UNREACH: ::c_int = 0;
+pub const NFT_REJECT_TCP_RST: ::c_int = 1;
+pub const NFT_REJECT_ICMPX_UNREACH: ::c_int = 2;
+
+pub const NFT_REJECT_ICMPX_NO_ROUTE: ::c_int = 0;
+pub const NFT_REJECT_ICMPX_PORT_UNREACH: ::c_int = 1;
+pub const NFT_REJECT_ICMPX_HOST_UNREACH: ::c_int = 2;
+pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: ::c_int = 3;
+
+pub const NFT_NAT_SNAT: ::c_int = 0;
+pub const NFT_NAT_DNAT: ::c_int = 1;
+
+pub const NFT_TRACETYPE_UNSPEC: ::c_int = 0;
+pub const NFT_TRACETYPE_POLICY: ::c_int = 1;
+pub const NFT_TRACETYPE_RETURN: ::c_int = 2;
+pub const NFT_TRACETYPE_RULE: ::c_int = 3;
+
+pub const NFT_NG_INCREMENTAL: ::c_int = 0;
+pub const NFT_NG_RANDOM: ::c_int = 1;
+
+pub const M_MXFAST: ::c_int = 1;
+pub const M_NLBLKS: ::c_int = 2;
+pub const M_GRAIN: ::c_int = 3;
+pub const M_KEEP: ::c_int = 4;
+pub const M_TRIM_THRESHOLD: ::c_int = -1;
+pub const M_TOP_PAD: ::c_int = -2;
+pub const M_MMAP_THRESHOLD: ::c_int = -3;
+pub const M_MMAP_MAX: ::c_int = -4;
+pub const M_CHECK_ACTION: ::c_int = -5;
+pub const M_PERTURB: ::c_int = -6;
+pub const M_ARENA_TEST: ::c_int = -7;
+pub const M_ARENA_MAX: ::c_int = -8;
+
#[doc(hidden)]
pub const AF_MAX: ::c_int = 42;
#[doc(hidden)]
@@ -552,6 +852,13 @@ cfg_if! {
pub const PTHREAD_STACK_MIN: ::size_t = 131072;
}
}
+pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 3;
+
+f! {
+ pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
+ return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
+ }
+}
extern {
pub fn utmpxname(file: *const ::c_char) -> ::c_int;
@@ -562,6 +869,7 @@ extern {
pub fn setutxent();
pub fn endutxent();
pub fn getpt() -> ::c_int;
+ pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int;
}
#[link(name = "util")]
@@ -597,6 +905,22 @@ extern {
pub fn pthread_rwlockattr_setkind_np(attr: *mut ::pthread_rwlockattr_t,
val: ::c_int) -> ::c_int;
pub fn sched_getcpu() -> ::c_int;
+ pub fn mallinfo() -> ::mallinfo;
+ pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
+ pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
+ #[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
+ #[cfg_attr(target_os = "solaris", link_name = "__posix_getpwent_r")]
+ pub fn getpwent_r(pwd: *mut ::unix::notbsd::linux::passwd,
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ result: *mut *mut ::unix::notbsd
+ ::linux::passwd) -> ::c_int;
+ #[cfg_attr(target_os = "netbsd", link_name = "__getgrent_r50")]
+ #[cfg_attr(target_os = "solaris", link_name = "__posix_getgrent_r")]
+ pub fn getgrent_r(grp: *mut ::group,
+ buf: *mut ::c_char,
+ buflen: ::size_t,
+ result: *mut *mut ::group) -> ::c_int;
}
cfg_if! {