1// Copyright 2017 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 std::ffi::CStr;
67use crate::rutabaga_os::descriptor::AsRawDescriptor;
8use crate::rutabaga_os::descriptor::IntoRawDescriptor;
9use crate::rutabaga_os::RawDescriptor;
10use crate::rutabaga_utils::RutabagaError;
11use crate::rutabaga_utils::RutabagaResult;
1213pub struct SharedMemory {
14 size: u64,
15}
1617impl SharedMemory {
18/// Creates a new shared memory file descriptor with zero size.
19pub fn new(_debug_name: &CStr, _size: u64) -> RutabagaResult<SharedMemory> {
20Err(RutabagaError::Unsupported)
21 }
2223/// Gets the size in bytes of the shared memory.
24 ///
25 /// The size returned here does not reflect changes by other interfaces or users of the shared
26 /// memory file descriptor..
27pub fn size(&self) -> u64 {
28self.size
29 }
30}
3132impl AsRawDescriptor for SharedMemory {
33fn as_raw_descriptor(&self) -> RawDescriptor {
34unimplemented!()
35 }
36}
3738impl IntoRawDescriptor for SharedMemory {
39fn into_raw_descriptor(self) -> RawDescriptor {
40unimplemented!()
41 }
42}
4344/// Uses the system's page size in bytes to round the given value up to the nearest page boundary.
45pub fn round_up_to_page_size(_v: u64) -> RutabagaResult<u64> {
46Err(RutabagaError::Unsupported)
47}