1// Copyright 2023 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
45use libc::c_void;
67use crate::rutabaga_os::SafeDescriptor;
8use crate::rutabaga_utils::RutabagaError;
9use crate::rutabaga_utils::RutabagaResult;
1011/// Wraps an anonymous shared memory mapping in the current process. Provides
12/// RAII semantics including munmap when no longer needed.
13#[derive(Debug)]
14pub struct MemoryMapping {
15pub addr: *mut c_void,
16pub size: usize,
17}
1819impl MemoryMapping {
20pub fn from_safe_descriptor(
21 _descriptor: SafeDescriptor,
22 _size: usize,
23 _map_info: u32,
24 ) -> RutabagaResult<MemoryMapping> {
25Err(RutabagaError::Unsupported)
26 }
27}