pub fn sys_debuglog_write(
        &self,
        handle_value: HandleValue,
        options: u32,
        buf: UserInPtr<u8>,
        len: usize,
    ) -> ZxResult {
        info!(
            "debuglog.write: handle={:#x?}, options={:#x?}, buf=({:#x?}; {:#x?})",
            handle_value, options, buf, len,
        );
        const LOG_FLAGS_MASK: u32 = 0x10;
        if options & !LOG_FLAGS_MASK != 0 {
            return Err(ZxError::INVALID_ARGS);
        }
        let datalen = len.min(224);
        let data = buf.read_string(datalen as usize)?;
        let proc = self.thread.proc();
        let dlog = proc.get_object_with_rights::<DebugLog>(handle_value, Rights::WRITE)?;
        dlog.write(Severity::Info, options, self.thread.id(), proc.id(), &data);
        // print to kernel console
        kernel_hal::console::console_write(&data);
        if data.as_bytes().last() != Some(&b'\n') {
            kernel_hal::console::console_write("\n");
        }
        Ok(())
    }
/// Write log entry to debuglog.
Write log entry to debuglog.
Write log entry to debuglog .
pub fn sys_debuglog_write(
        &self,
        handle_value: HandleValue,
        options: u32,
        buf: UserInPtr<u8>,
        len: usize,
    ) -> ZxResult {
        info!(
            "debuglog.write: handle={:#x?}, options={:#x?}, buf=({:#x?}; {:#x?})",
            handle_value, options, buf, len,
        );
        const LOG_FLAGS_MASK: u32 = 0x10;
        if options & !LOG_FLAGS_MASK != 0 {
            return Err(ZxError::INVALID_ARGS);
        }
        let datalen = len.min(224);
        let data = buf.read_string(datalen as usize)?;
        let proc = self.thread.proc();
        let dlog = proc.get_object_with_rights::<DebugLog>(handle_value, Rights::WRITE)?;
        dlog.write(Severity::Info, options, self.thread.id(), proc.id(), &data);
        // print to kernel console
        kernel_hal::console::console_write(&data);
        if data.as_bytes().last() != Some(&b'\n') {
            kernel_hal::console::console_write("\n");
        }
        Ok(())
    }
pub fn sys_debuglog_write ( & self , handle_value : HandleValue , options : u32 , buf : UserInPtr < u8 > , len : usize , ) -> ZxResult { info ! ( " " handle_value options buf len ) ; const LOG_FLAGS_MASK : u32 = 0x10 ; if options & ! LOG_FLAGS_MASK != 0 { return Err ( ZxError :: INVALID_ARGS ) ; } let datalen = len . min ( 224 ) ; let data = buf . read_string ( datalen as usize ) ? ; let proc = self . thread . proc ( ) ; let dlog = proc . get_object_with_rights :: < DebugLog > ( handle_value , Rights :: WRITE ) ? ; dlog . write ( Severity :: Info , options , self . thread . id ( ) , proc . id ( ) , & data ) ; // print to kernel console kernel_hal :: console :: console_write ( & data ) ; if data . as_bytes ( ) . last ( ) != Some ( & b'\n' ) { kernel_hal :: console :: console_write ( " \n " ) ; } Ok ( ( ) ) }
Write log entry to debuglog.
Write log entry to debuglog .
&self
handle_value
HandleValue
options
u32
buf
UserInPtr<u8>
len
usize
&self
handle_value
HandleValue
options
u32
buf
UserInPtr<u8>
len
usize