fn write(&self, args_ptr: usize) -> io::Result<()> {
		let syswrite = unsafe { &*(args_ptr as *const SysWrite) };
		let mut bytes_written: usize = 0;
		let buffer = self.virt_to_phys(syswrite.buf as usize);

		while bytes_written != syswrite.len {
			unsafe {
				let step = libc::write(
					syswrite.fd,
					self.host_address(buffer + bytes_written) as *const libc::c_void,
					syswrite.len - bytes_written,
				);
				if step >= 0 {
					bytes_written += step as usize;
				} else {
					return Err(io::Error::last_os_error());
				}
			}
		}

		Ok(())
	}
/// Handles an write syscall on the host.
Handles an write syscall on the host.
Handles an write syscall on the host .
fn write(&self, args_ptr: usize) -> io::Result<()> {
		let syswrite = unsafe { &*(args_ptr as *const SysWrite) };
		let mut bytes_written: usize = 0;
		let buffer = self.virt_to_phys(syswrite.buf as usize);
		while bytes_written != syswrite.len {
			unsafe {
				let step = libc::write(
					syswrite.fd,
					self.host_address(buffer + bytes_written) as *const libc::c_void,
					syswrite.len - bytes_written,
				);
				if step >= 0 {
					bytes_written += step as usize;
				} else {
					return Err(io::Error::last_os_error());
				}
			}
		}
		Ok(())
	}
fn write ( & self , args_ptr : usize ) -> io :: Result < ( ) > { let syswrite = unsafe { & * ( args_ptr as * const SysWrite ) } ; let mut bytes_written : usize = 0 ; let buffer = self . virt_to_phys ( syswrite . buf as usize ) ; while bytes_written != syswrite . len { unsafe { let step = libc :: write ( syswrite . fd , self . host_address ( buffer + bytes_written ) as * const libc :: c_void , syswrite . len - bytes_written , ) ; if step >= 0 { bytes_written += step as usize ; } else { return Err ( io :: Error :: last_os_error ( ) ) ; } } } Ok ( ( ) ) }
Handles an write syscall on the host.
Handles an write syscall on the host .
&self
args_ptr
usize
&self
args_ptr
usize