remove sys_types from the shadow header

This commit is contained in:
auronandace
2026-05-25 07:58:33 +01:00
parent 6ec441d72f
commit 33dbe1aab8
2 changed files with 10 additions and 1 deletions
+4 -1
View File
@@ -1,4 +1,7 @@
sys_includes = ["sys/types.h", "stdint.h", "stdio.h"]
sys_includes = ["stdint.h", "stdio.h"]
after_includes = """
#include <bits/size-t.h> // for size_t from sys/types.h
"""
include_guard = "_RELIBC_SHADOW_H"
language = "C"
style = "Tag"
+6
View File
@@ -23,12 +23,15 @@ use crate::{
use super::errno::*;
/// cbindgen:ignore
#[cfg(target_os = "linux")]
const SEPARATOR: char = ':';
/// cbindgen:ignore
#[cfg(target_os = "redox")]
const SEPARATOR: char = ';';
/// cbindgen:ignore
const SHADOW_FILE: &core::ffi::CStr = c"/etc/shadow";
#[derive(Clone, Copy, Debug)]
@@ -65,7 +68,9 @@ impl DerefMut for MaybeAllocated {
}
}
/// cbindgen:ignore
static mut SHADOW_BUF: Option<MaybeAllocated> = None;
/// cbindgen:ignore
static mut SHADOW: spwd = spwd {
sp_namp: ptr::null_mut(),
sp_pwdp: ptr::null_mut(),
@@ -78,6 +83,7 @@ static mut SHADOW: spwd = spwd {
sp_flag: 0,
};
/// cbindgen:ignore
static LINE_READER: SyncUnsafeCell<Option<Lines<BufReader<File>>>> = SyncUnsafeCell::new(None);
/// Non-POSIX, see <https://www.man7.org/linux/man-pages/man3/getspnam.3.html>.