Merge branch 'statvfs-bits' into 'master'

remove sys_types from sys_statvfs header

See merge request redox-os/relibc!1320
This commit is contained in:
Jeremy Soller
2026-05-12 10:15:34 -06:00
6 changed files with 46 additions and 11 deletions
+20
View File
@@ -0,0 +1,20 @@
# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_types.h.html
#
# These types are split out to prevent importing all of sys/types.h into sys/statvfs.h.
#
# POSIX headers that require fsblkcnt_t and fsfilcnt_t:
# - sys/statvfs.h
# - sys/types.h (where they should be defined)
sys_includes = []
include_guard = "_RELIBC_BITS_SYS_STATVFS_H"
language = "C"
style = "type"
no_includes = true
cpp_compat = true
[export]
include = [
"fsblkcnt_t",
"fsfilcnt_t"
]
[enum]
prefix_with_name = true
+8
View File
@@ -0,0 +1,8 @@
use crate::platform::types::c_ulong;
/// Used for file system block counts.
#[allow(non_camel_case_types)]
pub type fsblkcnt_t = c_ulong;
/// Used for file system file counts.
#[allow(non_camel_case_types)]
pub type fsfilcnt_t = c_ulong;
+1
View File
@@ -35,6 +35,7 @@ pub mod bits_socklen_t;
pub mod bits_ssize_t;
#[path = "bits_suseconds-t/mod.rs"]
pub mod bits_suseconds_t;
pub mod bits_sys_statvfs;
#[path = "bits_time-t/mod.rs"]
pub mod bits_time_t;
pub mod bits_timespec;
+4 -1
View File
@@ -2,7 +2,10 @@
#
# Spec quotations relating to includes:
# - "The <sys/statvfs.h> header shall define the fsblkcnt_t and fsfilcnt_t types as described in <sys/types.h>."
sys_includes = ["sys/types.h"]
sys_includes = []
after_includes = """
#include <bits/sys/statvfs.h> // for fsblkcnt_t and fsfilcnt_t from sys/types.h
"""
include_guard = "_RELIBC_SYS_STATVFS_H"
language = "C"
style = "Tag"
+1 -2
View File
@@ -11,6 +11,7 @@ after_includes = """
#include <bits/pid-t.h>
#include <bits/ssize-t.h>
#include <bits/suseconds-t.h>
#include <bits/sys/statvfs.h> // for fsblkcnt_t and fsfilcnt_t
#include <bits/time-t.h>
#include <bits/uid-t.h>
@@ -30,8 +31,6 @@ include = [
"nlink_t",
"useconds_t",
"blkcnt_t",
"fsblkcnt_t",
"fsfilcnt_t",
"u_char",
"uchar",
"u_short",
+12 -8
View File
@@ -8,9 +8,18 @@
//! for the old specification.
pub use crate::header::{
bits_clock_t::clock_t, bits_clockid_t::clockid_t, bits_gid_t::gid_t, bits_id_t::id_t,
bits_mode_t::mode_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_clockid_t::clockid_t,
bits_gid_t::gid_t,
bits_id_t::id_t,
bits_mode_t::mode_t,
bits_off_t::off_t,
bits_pid_t::pid_t,
bits_ssize_t::ssize_t,
bits_suseconds_t::suseconds_t,
bits_sys_statvfs::{fsblkcnt_t, fsfilcnt_t},
bits_time_t::time_t,
bits_uid_t::uid_t,
};
use crate::platform::types::{
c_char, c_long, c_longlong, c_uchar, c_uint, c_ulong, c_ulonglong, c_ushort,
@@ -33,11 +42,6 @@ pub type useconds_t = c_uint;
/// Used for file block counts.
pub type blkcnt_t = c_longlong;
/// Used for file system block counts.
pub type fsblkcnt_t = c_ulong;
/// Used for file system file counts.
pub type fsfilcnt_t = c_ulong;
pub type u_char = c_uchar;
pub type uchar = c_uchar;
pub type u_short = c_ushort;