|
|
@ -50,6 +50,7 @@ use std::{
|
|
|
|
use crate::util::KernelVersion;
|
|
|
|
use crate::util::KernelVersion;
|
|
|
|
use libc::{getrlimit, rlimit, RLIMIT_MEMLOCK, RLIM_INFINITY};
|
|
|
|
use libc::{getrlimit, rlimit, RLIMIT_MEMLOCK, RLIM_INFINITY};
|
|
|
|
use log::warn;
|
|
|
|
use log::warn;
|
|
|
|
|
|
|
|
use obj::maps::InvalidMapTypeError;
|
|
|
|
use thiserror::Error;
|
|
|
|
use thiserror::Error;
|
|
|
|
|
|
|
|
|
|
|
|
use crate::{
|
|
|
|
use crate::{
|
|
|
@ -185,6 +186,13 @@ pub enum MapError {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
impl From<InvalidMapTypeError> for MapError {
|
|
|
|
|
|
|
|
fn from(e: InvalidMapTypeError) -> Self {
|
|
|
|
|
|
|
|
let InvalidMapTypeError { map_type } = e;
|
|
|
|
|
|
|
|
MapError::InvalidMapType { map_type }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// A map file descriptor.
|
|
|
|
/// A map file descriptor.
|
|
|
|
pub struct MapFd(RawFd);
|
|
|
|
pub struct MapFd(RawFd);
|
|
|
|
|
|
|
|
|
|
|
|