fn read(&self, args_ptr: usize) {
		unsafe {
			let sysread = &mut *(args_ptr as *mut SysRead);
			let buffer = self.virt_to_phys(sysread.buf as usize);

			let bytes_read = libc::read(
				sysread.fd,
				self.host_address(buffer) as *mut libc::c_void,
				sysread.len,
			);
			if bytes_read >= 0 {
				sysread.ret = bytes_read;
			} else {
				sysread.ret = -1;
			}
		}
	}
/// Handles an read syscall on the host.
Handles an read syscall on the host.
Handles an read syscall on the host .
fn read(&self, args_ptr: usize) {
		unsafe {
			let sysread = &mut *(args_ptr as *mut SysRead);
			let buffer = self.virt_to_phys(sysread.buf as usize);
			let bytes_read = libc::read(
				sysread.fd,
				self.host_address(buffer) as *mut libc::c_void,
				sysread.len,
			);
			if bytes_read >= 0 {
				sysread.ret = bytes_read;
			} else {
				sysread.ret = -1;
			}
		}
	}
fn read ( & self , args_ptr : usize ) { unsafe { let sysread = & mut * ( args_ptr as * mut SysRead ) ; let buffer = self . virt_to_phys ( sysread . buf as usize ) ; let bytes_read = libc :: read ( sysread . fd , self . host_address ( buffer ) as * mut libc :: c_void , sysread . len , ) ; if bytes_read >= 0 { sysread . ret = bytes_read ; } else { sysread . ret = - 1 ; } } }
Handles an read syscall on the host.
Handles an read syscall on the host .
&self
args_ptr
usize
&self
args_ptr
usize