split out uid_t from sys_types

This commit is contained in:
auronandace
2026-05-10 16:28:22 +01:00
parent 8d9da76434
commit a365dbeda4
5 changed files with 30 additions and 4 deletions
+21
View File
@@ -0,0 +1,21 @@
# 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 uid_t:
# - pwd.h
# - signal.h
# - sys/ipc.h (TODO not present in relibc)
# - sys/stat.h
# - sys/types.h (where it should be defined)
# - unistd.h
sys_includes = []
include_guard = "_RELIBC_BITS_UID_T_H"
language = "C"
style = "type"
no_includes = true
cpp_compat = true
[export]
include = ["uid_t"]
[enum]
prefix_with_name = true
+5
View File
@@ -0,0 +1,5 @@
use crate::platform::types::c_int;
/// Used for user IDs.
#[allow(non_camel_case_types)]
pub type uid_t = c_int;
+2
View File
@@ -31,6 +31,8 @@ pub mod bits_suseconds_t;
pub mod bits_time_t;
pub mod bits_timespec;
pub mod bits_timeval;
#[path = "bits_uid-t/mod.rs"]
pub mod bits_uid_t;
// complex.h implemented in C (currently through openlibm)
pub mod cpio;
pub mod crypt;
+1 -1
View File
@@ -8,6 +8,7 @@ after_includes = """
#include <bits/ssize-t.h>
#include <bits/suseconds-t.h>
#include <bits/time-t.h>
#include <bits/uid-t.h>
typedef void* timer_t;
"""
@@ -22,7 +23,6 @@ include = [
"dev_t",
"ino_t",
"reclen_t",
"uid_t",
"mode_t",
"nlink_t",
"id_t",
+1 -3
View File
@@ -9,7 +9,7 @@
pub use crate::header::{
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_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,
@@ -23,8 +23,6 @@ pub type dev_t = c_ulonglong;
pub type ino_t = c_ulonglong;
/// Used for directory entry lengths.
pub type reclen_t = c_ushort;
/// Used for user IDs.
pub type uid_t = c_int;
/// Used for some file attributes.
#[cfg(target_os = "linux")]
pub type mode_t = c_uint;