From a222fe84bf15ccf1d074f0411a7d2e28d2cc43ba Mon Sep 17 00:00:00 2001 From: Wildan M Date: Mon, 18 May 2026 15:29:44 +0700 Subject: [PATCH] Fix sys/resource.h by avoiding stdint --- src/header/sys_resource/cbindgen.toml | 4 +--- src/header/sys_resource/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/header/sys_resource/cbindgen.toml b/src/header/sys_resource/cbindgen.toml index 3d0766cec4..43b32e07c4 100644 --- a/src/header/sys_resource/cbindgen.toml +++ b/src/header/sys_resource/cbindgen.toml @@ -1,7 +1,5 @@ -# stdint.h needed for uint64_t due to rlim_t and constants u64 -# TODO POSIX says rlim_t can be unsigned int but including stdint.h is considered namespace pollution # sys/time.h brings in sys/select.h which brings in bits/timeval.h -sys_includes = ["stdint.h", "sys/time.h"] +sys_includes = ["sys/time.h"] after_includes = """ #include // for id_t from sys/types.h """ diff --git a/src/header/sys_resource/mod.rs b/src/header/sys_resource/mod.rs index 93714bae6f..83bbbab2e8 100644 --- a/src/header/sys_resource/mod.rs +++ b/src/header/sys_resource/mod.rs @@ -8,7 +8,7 @@ use crate::{ out::Out, platform::{ Pal, Sys, - types::{c_int, c_long, id_t}, + types::{c_int, c_long, c_ulonglong, id_t}, }, }; @@ -38,7 +38,7 @@ pub const RLIMIT_NICE: c_int = 13; pub const RLIMIT_RTPRIO: c_int = 14; pub const RLIMIT_NLIMITS: c_int = 15; -pub type rlim_t = u64; +pub type rlim_t = c_ulonglong; #[repr(C)] pub struct rlimit {