Files
mystuff/devel/aichat/patches/patch-modcargo-crates_mmap-rs-0.6.1_src_os_impl_openbsd.rs
2026-07-08 11:08:46 +02:00

31 lines
1001 B
Rust

--- /dev/null Tue Jul 8 00:00:00 2026
+++ modcargo-crates/mmap-rs-0.6.1/src/os_impl/openbsd.rs Tue Jul 8 00:00:00 2026
@@ -0,0 +1,27 @@
+use crate::areas::{MemoryArea, Protection, ShareMode};
+use crate::error::Error;
+use std::fs::File;
+use std::io::BufReader;
+use std::marker::PhantomData;
+use std::ops::Range;
+
+/// Stub MemoryAreas for OpenBSD.
+/// OpenBSD does not expose a portable /proc vmmap interface; hnsw_rs only
+/// uses Mmap/MmapOptions so this path is never called at runtime.
+pub struct MemoryAreas<B> {
+ _phantom: PhantomData<B>,
+}
+
+impl MemoryAreas<BufReader<File>> {
+ pub fn open(_pid: Option<u32>, _range: Option<Range<usize>>) -> Result<Self, Error> {
+ Err(Error::Io(std::io::Error::new(
+ std::io::ErrorKind::Unsupported,
+ "MemoryAreas not supported on OpenBSD",
+ )))
+ }
+}
+
+impl<B> Iterator for MemoryAreas<B> {
+ type Item = Result<MemoryArea, Error>;
+ fn next(&mut self) -> Option<Self::Item> { None }
+}