pub struct SyscallBuffer {
buffer: Buffer,
size: usize,
access_type: MemoryRegionType,
}Fields§
§buffer: Buffer§size: usize§access_type: MemoryRegionTypeImplementations§
Source§impl SyscallBuffer
impl SyscallBuffer
Sourcepub fn new_in_current_process<K: Kernel>(
kernel: K,
access_type: MemoryRegionType,
address: usize,
length: isize,
) -> Result<Self>
pub fn new_in_current_process<K: Kernel>( kernel: K, access_type: MemoryRegionType, address: usize, length: isize, ) -> Result<Self>
Create a new buffer with access rights bound to the current process.
Sourcepub fn copy_into(
&self,
offset: usize,
into_buffer: &mut SyscallBuffer,
) -> Result<usize>
pub fn copy_into( &self, offset: usize, into_buffer: &mut SyscallBuffer, ) -> Result<usize>
Copy from this buffer into another.
Copies data from this buffer into into_buffer, starting at offset bytes
from the beginning of this buffer. Will copy maximum number of bytes
that exist and this buffer and will fit into into_buffer
§Returns
- Ok(0): No data was copied. This can occur if
offsetis equal to the size of the buffer or `into_buffer is of size zero. - Ok(len): Returns the number of bytes copied.
- Error::PermissionDenied: Either this buffer is not readable or
into_bufferis not writeable - Error::OutOfRange:
offsetis larger than the size of the buffer.