Fix elf.h typedef and ELFMAG, add IPPROTO_ICMPV6 and MSG_NOSIGNAL

This commit is contained in:
Wildan M
2026-06-07 00:17:04 +07:00
parent bcc1a0d43c
commit f484e108cc
4 changed files with 8 additions and 2 deletions
+3 -1
View File
@@ -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
+1 -1
View File
@@ -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;
+2
View File
@@ -83,6 +83,8 @@ pub const IPPROTO_UDP: u8 = 17;
pub const IPPROTO_IDP: u8 = 22;
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
pub const IPPROTO_IPV6: u8 = 41;
/// Non-POSIX.
pub const IPPROTO_ICMPV6: u8 = 58;
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
pub const IPPROTO_RAW: u8 = 0xff;
/// Non-POSIX.
+2
View File
@@ -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;