Merge branch 'sysstat-bits' into 'master'
split out blkcnt_t and blksize_t from sys_types header See merge request redox-os/relibc!1334
This commit is contained in:
@@ -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 blkcnt_t and blksize_t:
|
||||
# - sys/stat.h
|
||||
# - sys/types.h (where they should be defined)
|
||||
sys_includes = []
|
||||
include_guard = "_RELIBC_BITS_SYS_STAT_H"
|
||||
language = "C"
|
||||
style = "type"
|
||||
no_includes = true
|
||||
cpp_compat = true
|
||||
[export]
|
||||
include = [
|
||||
"blkcnt_t",
|
||||
"blksize_t"
|
||||
]
|
||||
[enum]
|
||||
prefix_with_name = true
|
||||
@@ -0,0 +1,9 @@
|
||||
use crate::platform::types::{c_long, c_longlong};
|
||||
|
||||
/// Used for file block counts.
|
||||
#[allow(non_camel_case_types)]
|
||||
pub type blkcnt_t = c_longlong;
|
||||
|
||||
/// Used for block sizes.
|
||||
#[allow(non_camel_case_types)]
|
||||
pub type blksize_t = c_long;
|
||||
@@ -37,6 +37,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_stat;
|
||||
pub mod bits_sys_statvfs;
|
||||
#[path = "bits_time-t/mod.rs"]
|
||||
pub mod bits_time_t;
|
||||
|
||||
@@ -11,6 +11,7 @@ after_includes = """
|
||||
#include <bits/pid-t.h>
|
||||
#include <bits/ssize-t.h>
|
||||
#include <bits/suseconds-t.h>
|
||||
#include <bits/sys/stat.h> // for blkcnt_t and blksize_t
|
||||
#include <bits/sys/statvfs.h> // for fsblkcnt_t and fsfilcnt_t
|
||||
#include <bits/time-t.h>
|
||||
#include <bits/timer-t.h>
|
||||
@@ -23,12 +24,10 @@ no_includes = true
|
||||
|
||||
[export]
|
||||
include = [
|
||||
"blksize_t",
|
||||
"dev_t",
|
||||
"reclen_t",
|
||||
"nlink_t",
|
||||
"useconds_t",
|
||||
"blkcnt_t",
|
||||
"u_char",
|
||||
"uchar",
|
||||
"u_short",
|
||||
|
||||
@@ -18,17 +18,14 @@ pub use crate::header::{
|
||||
bits_pid_t::pid_t,
|
||||
bits_ssize_t::ssize_t,
|
||||
bits_suseconds_t::suseconds_t,
|
||||
bits_sys_stat::{blkcnt_t, blksize_t},
|
||||
bits_sys_statvfs::{fsblkcnt_t, fsfilcnt_t},
|
||||
bits_time_t::time_t,
|
||||
bits_timer_t::timer_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,
|
||||
};
|
||||
use crate::platform::types::{c_char, c_longlong, c_uchar, c_uint, c_ulong, c_ulonglong, c_ushort};
|
||||
|
||||
/// Used for block sizes.
|
||||
pub type blksize_t = c_long;
|
||||
/// Used for device IDs.
|
||||
pub type dev_t = c_ulonglong;
|
||||
/// Used for directory entry lengths.
|
||||
@@ -37,9 +34,6 @@ pub type reclen_t = c_ushort;
|
||||
pub type nlink_t = c_ulong;
|
||||
pub type useconds_t = c_uint;
|
||||
|
||||
/// Used for file block counts.
|
||||
pub type blkcnt_t = c_longlong;
|
||||
|
||||
pub type u_char = c_uchar;
|
||||
pub type uchar = c_uchar;
|
||||
pub type u_short = c_ushort;
|
||||
|
||||
Reference in New Issue
Block a user