split out reclen_t from sys_types header

This commit is contained in:
auronandace
2026-05-16 16:55:53 +01:00
parent 291b6991ce
commit 4dd3c2ea70
5 changed files with 26 additions and 3 deletions
+17
View File
@@ -0,0 +1,17 @@
# 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 reclen_t:
# - dirent.h
# - sys/types.h (where it should be defined)
sys_includes = []
include_guard = "_RELIBC_BITS_RECLEN_T_H"
language = "C"
style = "type"
no_includes = true
cpp_compat = true
[export]
include = ["reclen_t"]
[enum]
prefix_with_name = true
+5
View File
@@ -0,0 +1,5 @@
use crate::platform::types::c_ushort;
/// Used for directory entry lengths.
#[allow(non_camel_case_types)]
pub type reclen_t = c_ushort;
+2
View File
@@ -29,6 +29,8 @@ pub mod bits_off_t;
#[path = "bits_pid-t/mod.rs"]
pub mod bits_pid_t;
pub mod bits_pthread;
#[path = "bits_reclen-t/mod.rs"]
pub mod bits_reclen_t;
#[path = "bits_safamily-t/mod.rs"]
pub mod bits_safamily_t;
#[path = "bits_sigset-t/mod.rs"]
+1 -1
View File
@@ -11,6 +11,7 @@ after_includes = """
#include <bits/nlink-t.h>
#include <bits/off-t.h>
#include <bits/pid-t.h>
#include <bits/reclen-t.h>
#include <bits/ssize-t.h>
#include <bits/suseconds-t.h>
#include <bits/sys/stat.h> // for blkcnt_t and blksize_t
@@ -26,7 +27,6 @@ no_includes = true
[export]
include = [
"reclen_t",
"useconds_t",
"u_char",
"uchar",
+1 -2
View File
@@ -18,6 +18,7 @@ pub use crate::header::{
bits_nlink_t::nlink_t,
bits_off_t::off_t,
bits_pid_t::pid_t,
bits_reclen_t::reclen_t,
bits_size_t::size_t,
bits_ssize_t::ssize_t,
bits_suseconds_t::suseconds_t,
@@ -29,8 +30,6 @@ pub use crate::header::{
};
use crate::platform::types::{c_char, c_longlong, c_uchar, c_uint, c_ulong, c_ulonglong, c_ushort};
/// Used for directory entry lengths.
pub type reclen_t = c_ushort;
pub type useconds_t = c_uint;
pub type u_char = c_uchar;