Make std::fs::File Send on UEFI

This commit is contained in:
ginnyTheCat
2026-03-26 17:42:08 +01:00
parent b711f95f86
commit a227bc7ee9
+5
View File
@@ -588,6 +588,11 @@ pub(crate) struct File {
path: crate::path::PathBuf,
}
// SAFETY: UEFI has no regular threads, and as per <https://github.com/rust-lang/rust/issues/133604>
// std does not support being invoked from "irregular threads" such as interrupt handlers or other
// CPU cores that run outside the scope of UEFI.
unsafe impl Send for File {}
impl File {
pub(crate) fn from_path(path: &Path, open_mode: u64, attr: u64) -> io::Result<Self> {
let absolute = crate::path::absolute(path)?;