diff --git a/src/header/bits_ino-t/cbindgen.toml b/src/header/bits_ino-t/cbindgen.toml new file mode 100644 index 0000000000..c9b9f6e8eb --- /dev/null +++ b/src/header/bits_ino-t/cbindgen.toml @@ -0,0 +1,18 @@ +# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_types.h.html +# +# This type is split out to prevent importing all of sys/types.h into other headers. +# +# POSIX headers that require ino_t: +# - dirent.h +# - sys/stat.h +# - sys/types.h (where it should be defined) +sys_includes = [] +include_guard = "_RELIBC_BITS_INO_T_H" +language = "C" +style = "type" +no_includes = true +cpp_compat = true +[export] +include = ["ino_t"] +[enum] +prefix_with_name = true diff --git a/src/header/bits_ino-t/mod.rs b/src/header/bits_ino-t/mod.rs new file mode 100644 index 0000000000..d6f4f666a9 --- /dev/null +++ b/src/header/bits_ino-t/mod.rs @@ -0,0 +1,5 @@ +use crate::platform::types::c_ulonglong; + +/// Used for serial numbers. +#[allow(non_camel_case_types)] +pub type ino_t = c_ulonglong; diff --git a/src/header/mod.rs b/src/header/mod.rs index 1329b98377..5c58b3a09b 100644 --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -13,6 +13,8 @@ pub mod bits_clockid_t; pub mod bits_gid_t; #[path = "bits_id-t/mod.rs"] pub mod bits_id_t; +#[path = "bits_ino-t/mod.rs"] +pub mod bits_ino_t; pub mod bits_iovec; #[path = "bits_locale-t/mod.rs"] pub mod bits_locale_t; diff --git a/src/header/sys_types_internal/cbindgen.toml b/src/header/sys_types_internal/cbindgen.toml index 77cfd197e1..a79f81b163 100644 --- a/src/header/sys_types_internal/cbindgen.toml +++ b/src/header/sys_types_internal/cbindgen.toml @@ -6,6 +6,7 @@ after_includes = """ #include #include #include +#include #include #include #include @@ -26,7 +27,6 @@ no_includes = true include = [ "blksize_t", "dev_t", - "ino_t", "reclen_t", "nlink_t", "useconds_t", diff --git a/src/header/sys_types_internal/mod.rs b/src/header/sys_types_internal/mod.rs index 9be3572cde..aa499b3c72 100644 --- a/src/header/sys_types_internal/mod.rs +++ b/src/header/sys_types_internal/mod.rs @@ -12,6 +12,7 @@ pub use crate::header::{ bits_clockid_t::clockid_t, bits_gid_t::gid_t, bits_id_t::id_t, + bits_ino_t::ino_t, bits_mode_t::mode_t, bits_off_t::off_t, bits_pid_t::pid_t, @@ -29,8 +30,6 @@ use crate::platform::types::{ pub type blksize_t = c_long; /// Used for device IDs. pub type dev_t = c_ulonglong; -/// Used for serial numbers. -pub type ino_t = c_ulonglong; /// Used for directory entry lengths. pub type reclen_t = c_ushort; /// Used for link counts.