pub fn sys_debuglog_read(
        &self,
        handle_value: HandleValue,
        options: u32,
        mut buf: UserOutPtr<u8>,
        len: usize,
    ) -> ZxResult {
        info!(
            "debuglog.read: handle={:#x?}, options={:#x?}, buf=({:#x?}; {:#x?})",
            handle_value, options, buf, len,
        );
        if options != 0 {
            return Err(ZxError::INVALID_ARGS);
        }
        let proc = self.thread.proc();
        let mut buffer = [0; DLOG_MAX_LEN];
        let dlog = proc.get_object_with_rights::<DebugLog>(handle_value, Rights::READ)?;
        let actual_len = dlog.read(&mut buffer).min(len);
        if actual_len == 0 {
            return Err(ZxError::SHOULD_WAIT);
        }
        buf.write_array(&buffer[..actual_len])?;
        // special case: return actual_len as status
        Err(unsafe { core::mem::transmute(actual_len as u32) })
    }
/// Read log entries from debuglog.
Read log entries from debuglog.
Read log entries from debuglog .
pub fn sys_debuglog_read(
        &self,
        handle_value: HandleValue,
        options: u32,
        mut buf: UserOutPtr<u8>,
        len: usize,
    ) -> ZxResult {
        info!(
            "debuglog.read: handle={:#x?}, options={:#x?}, buf=({:#x?}; {:#x?})",
            handle_value, options, buf, len,
        );
        if options != 0 {
            return Err(ZxError::INVALID_ARGS);
        }
        let proc = self.thread.proc();
        let mut buffer = [0; DLOG_MAX_LEN];
        let dlog = proc.get_object_with_rights::<DebugLog>(handle_value, Rights::READ)?;
        let actual_len = dlog.read(&mut buffer).min(len);
        if actual_len == 0 {
            return Err(ZxError::SHOULD_WAIT);
        }
        buf.write_array(&buffer[..actual_len])?;
        // special case: return actual_len as status
        Err(unsafe { core::mem::transmute(actual_len as u32) })
    }
pub fn sys_debuglog_read ( & self , handle_value : HandleValue , options : u32 , mut buf : UserOutPtr < u8 > , len : usize , ) -> ZxResult { info ! ( " " handle_value options buf len ) ; if options != 0 { return Err ( ZxError :: INVALID_ARGS ) ; } let proc = self . thread . proc ( ) ; let mut buffer = [ 0 ; DLOG_MAX_LEN ] ; let dlog = proc . get_object_with_rights :: < DebugLog > ( handle_value , Rights :: READ ) ? ; let actual_len = dlog . read ( & mut buffer ) . min ( len ) ; if actual_len == 0 { return Err ( ZxError :: SHOULD_WAIT ) ; } buf . write_array ( & buffer [ .. actual_len ] ) ? ; // special case: return actual_len as status Err ( unsafe { core :: mem :: transmute ( actual_len as u32 ) } ) }
Read log entries from debuglog.
Read log entries from debuglog .
&self
handle_value
HandleValue
options
u32
buf
UserOutPtr<u8>
len
usize
&self
handle_value
HandleValue
options
u32
buf
UserOutPtr<u8>
len
usize