Merge branch 'split-offt' into 'master'

split out off_t from sys_types_internal

See merge request redox-os/relibc!1284
This commit is contained in:
Jeremy Soller
2026-05-09 06:18:51 -06:00
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 off_t:
# - fcntl.h
# - stdio.h
# - sys/mman.h
# - sys/stat.h
# - sys/types.h (where it should be defined)
# - unistd.h
sys_includes = []
include_guard = "_RELIBC_BITS_OFF_T_H"
language = "C"
style = "type"
no_includes = true
cpp_compat = true
[export]
include = ["off_t"]
[enum]
prefix_with_name = true
+5
View File
@@ -0,0 +1,5 @@
use crate::platform::types::c_longlong;
/// Used for file sizes.
#[allow(non_camel_case_types)]
pub type off_t = c_longlong;
+2
View File
@@ -8,6 +8,8 @@ pub mod bits_arpainet;
pub mod bits_iovec;
#[path = "bits_locale-t/mod.rs"]
pub mod bits_locale_t;
#[path = "bits_off-t/mod.rs"]
pub mod bits_off_t;
pub mod bits_pthread;
#[path = "bits_safamily-t/mod.rs"]
pub mod bits_safamily_t;
+1 -1
View File
@@ -2,6 +2,7 @@
sys_includes = ["stddef.h"]
# TODO: figure out how to export void* type
after_includes = """
#include <bits/off-t.h>
#include <bits/ssize-t.h>
#include <bits/suseconds-t.h>
#include <bits/time-t.h>
@@ -23,7 +24,6 @@ include = [
"uid_t",
"mode_t",
"nlink_t",
"off_t",
"pid_t",
"id_t",
"useconds_t",
+1 -3
View File
@@ -8,7 +8,7 @@
//! for the old specification.
pub use crate::header::{
bits_ssize_t::ssize_t, bits_suseconds_t::suseconds_t, bits_time_t::time_t,
bits_off_t::off_t, bits_ssize_t::ssize_t, bits_suseconds_t::suseconds_t, bits_time_t::time_t,
};
use crate::platform::types::{
c_char, c_int, c_long, c_longlong, c_uchar, c_uint, c_ulong, c_ulonglong, c_ushort,
@@ -34,8 +34,6 @@ pub type mode_t = c_uint;
pub type mode_t = c_int;
/// Used for link counts.
pub type nlink_t = c_ulong;
/// Used for file sizes.
pub type off_t = c_longlong;
/// Used for process IDs and process group IDs.
pub type pid_t = c_int;
/// Used as a general identifier; can be used to contain at least a pid_t, uid_t, or gid_t.