diff --git a/src/header/elf/cbindgen.toml b/src/header/elf/cbindgen.toml index 93f227280c..710d99558c 100644 --- a/src/header/elf/cbindgen.toml +++ b/src/header/elf/cbindgen.toml @@ -1,5 +1,7 @@ sys_includes = ["stdint.h"] after_includes = """ +#define ELFMAG \"\\x7f\" \"ELF\" + #define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4) #define ELF32_ST_TYPE(val) ((val) & 0xf) #define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) @@ -39,7 +41,7 @@ after_includes = """ """ include_guard = "_ELF_H" language = "C" -style = "Tag" +style = "Both" no_includes = true cpp_compat = true diff --git a/src/header/elf/mod.rs b/src/header/elf/mod.rs index e2e9ea768c..4c83dc370a 100644 --- a/src/header/elf/mod.rs +++ b/src/header/elf/mod.rs @@ -77,7 +77,7 @@ pub const EI_MAG2: usize = 2; pub const ELFMAG2: c_char = 'L' as c_char; pub const EI_MAG3: usize = 3; pub const ELFMAG3: c_char = 'F' as c_char; -pub const ELFMAG: &str = "\x7fELF"; +// ELFMAG is defined in cbindgen.toml pub const SELFMAG: usize = 4; pub const EI_CLASS: usize = 4; pub const ELFCLASSNONE: usize = 0; diff --git a/src/header/netinet_in/mod.rs b/src/header/netinet_in/mod.rs index 0e4ced5c15..763772be80 100644 --- a/src/header/netinet_in/mod.rs +++ b/src/header/netinet_in/mod.rs @@ -83,6 +83,8 @@ pub const IPPROTO_UDP: u8 = 17; pub const IPPROTO_IDP: u8 = 22; /// See . pub const IPPROTO_IPV6: u8 = 41; +/// Non-POSIX. +pub const IPPROTO_ICMPV6: u8 = 58; /// See . pub const IPPROTO_RAW: u8 = 0xff; /// Non-POSIX. diff --git a/src/header/sys_socket/constants.rs b/src/header/sys_socket/constants.rs index f043163a74..bb5ff45466 100644 --- a/src/header/sys_socket/constants.rs +++ b/src/header/sys_socket/constants.rs @@ -139,6 +139,8 @@ pub const MSG_TRUNC: c_int = 32; pub const MSG_DONTWAIT: c_int = 64; /// Attempt to fill the read buffer. pub const MSG_WAITALL: c_int = 256; +/// Do not generate SIGPIPE +pub const MSG_NOSIGNAL: c_int = 0x4000; /// Atomically set the `FD_CLOEXEC` flag on any file descriptors created via /// `SCM_RIGHTS` during `recvmsg()`. pub const MSG_CMSG_CLOEXEC: c_int = 0x40000000;