Merge branch 'split-idt' into 'master'

split out id_t from sys_types

See merge request redox-os/relibc!1308
This commit is contained in:
Jeremy Soller
2026-05-11 10:30:37 -06:00
5 changed files with 29 additions and 5 deletions
+18
View File
@@ -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 id_t:
# - sys/resource.h
# - sys/types.h (where it should be defined)
# - sys/wait.h
sys_includes = []
include_guard = "_RELIBC_BITS_ID_T_H"
language = "C"
style = "type"
no_includes = true
cpp_compat = true
[export]
include = ["id_t"]
[enum]
prefix_with_name = true
+5
View File
@@ -0,0 +1,5 @@
use crate::platform::types::c_uint;
/// Used as a general identifier; can be used to contain at least a pid_t, uid_t, or gid_t.
#[allow(non_camel_case_types)]
pub type id_t = c_uint;
+2
View File
@@ -9,6 +9,8 @@ pub mod bits_arpainet;
pub mod bits_clock_t;
#[path = "bits_gid-t/mod.rs"]
pub mod bits_gid_t;
#[path = "bits_id-t/mod.rs"]
pub mod bits_id_t;
pub mod bits_iovec;
#[path = "bits_locale-t/mod.rs"]
pub mod bits_locale_t;
+1 -1
View File
@@ -4,6 +4,7 @@ sys_includes = ["stddef.h"]
after_includes = """
#include <bits/clock-t.h>
#include <bits/gid-t.h>
#include <bits/id-t.h>
#include <bits/off-t.h>
#include <bits/pid-t.h>
#include <bits/ssize-t.h>
@@ -26,7 +27,6 @@ include = [
"reclen_t",
"mode_t",
"nlink_t",
"id_t",
"useconds_t",
"clockid_t",
"blkcnt_t",
+3 -4
View File
@@ -8,8 +8,9 @@
//! for the old specification.
pub use crate::header::{
bits_clock_t::clock_t, bits_gid_t::gid_t, bits_off_t::off_t, bits_pid_t::pid_t,
bits_ssize_t::ssize_t, bits_suseconds_t::suseconds_t, bits_time_t::time_t, bits_uid_t::uid_t,
bits_clock_t::clock_t, bits_gid_t::gid_t, bits_id_t::id_t, bits_off_t::off_t,
bits_pid_t::pid_t, bits_ssize_t::ssize_t, bits_suseconds_t::suseconds_t, bits_time_t::time_t,
bits_uid_t::uid_t,
};
use crate::platform::types::{
c_char, c_int, c_long, c_longlong, c_uchar, c_uint, c_ulong, c_ulonglong, c_ushort,
@@ -31,8 +32,6 @@ pub type mode_t = c_uint;
pub type mode_t = c_int;
/// Used for link counts.
pub type nlink_t = c_ulong;
/// Used as a general identifier; can be used to contain at least a pid_t, uid_t, or gid_t.
pub type id_t = c_uint;
pub type useconds_t = c_uint;
/// Used for clock ID type in the clock and timer functions.