Merge branch 'split-nlinkt' into 'master'

split out nlink_t from sys_types header

See merge request redox-os/relibc!1338
This commit is contained in:
Jeremy Soller
2026-05-16 09:34:58 -06:00
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 nlink_t:
# - sys/stat.h
# - sys/types.h (where it should be defined)
sys_includes = []
include_guard = "_RELIBC_BITS_NLINK_T_H"
language = "C"
style = "type"
no_includes = true
cpp_compat = true
[export]
include = ["nlink_t"]
[enum]
prefix_with_name = true
+5
View File
@@ -0,0 +1,5 @@
use crate::platform::types::c_ulong;
/// Used for link counts.
#[allow(non_camel_case_types)]
pub type nlink_t = c_ulong;
+2
View File
@@ -22,6 +22,8 @@ pub mod bits_iovec;
pub mod bits_locale_t;
#[path = "bits_mode-t/mod.rs"]
pub mod bits_mode_t;
#[path = "bits_nlink-t/mod.rs"]
pub mod bits_nlink_t;
#[path = "bits_off-t/mod.rs"]
pub mod bits_off_t;
#[path = "bits_pid-t/mod.rs"]
+1 -1
View File
@@ -8,6 +8,7 @@ after_includes = """
#include <bits/id-t.h>
#include <bits/ino-t.h>
#include <bits/mode-t.h>
#include <bits/nlink-t.h>
#include <bits/off-t.h>
#include <bits/pid-t.h>
#include <bits/ssize-t.h>
@@ -26,7 +27,6 @@ no_includes = true
[export]
include = [
"reclen_t",
"nlink_t",
"useconds_t",
"u_char",
"uchar",
+1 -2
View File
@@ -15,6 +15,7 @@ pub use crate::header::{
bits_id_t::id_t,
bits_ino_t::ino_t,
bits_mode_t::mode_t,
bits_nlink_t::nlink_t,
bits_off_t::off_t,
bits_pid_t::pid_t,
bits_size_t::size_t,
@@ -30,8 +31,6 @@ use crate::platform::types::{c_char, c_longlong, c_uchar, c_uint, c_ulong, c_ulo
/// Used for directory entry lengths.
pub type reclen_t = c_ushort;
/// Used for link counts.
pub type nlink_t = c_ulong;
pub type useconds_t = c_uint;
pub type u_char = c_uchar;