pub fn sys_object_get_child(
        &self,
        handle: HandleValue,
        koid: KoID,
        rights: u32,
        mut out: UserOutPtr<HandleValue>,
    ) -> ZxResult {
        info!(
            "object.get_child: handle={:#x}, koid={:#x}, rights={:#x}",
            handle, koid, rights
        );
        let mut rights = Rights::from_bits(rights).ok_or(ZxError::INVALID_ARGS)?;
        let proc = self.thread.proc();
        let (task, parent_rights) = proc.get_dyn_object_and_rights(handle)?;
        if !parent_rights.contains(Rights::ENUMERATE) {
            return Err(ZxError::ACCESS_DENIED);
        }
        if rights == Rights::SAME_RIGHTS {
            rights = parent_rights;
        } else if (rights & parent_rights) != rights {
            return Err(ZxError::ACCESS_DENIED);
        }
        let child = task.get_child(koid)?;
        let child_handle = proc.add_handle(Handle::new(child, rights));
        out.write(child_handle)?;
        Ok(())
    }
/// Find the child of an object by its kid.
///
/// Given a kernel object with children objects, obtain a handle to the child specified by the provided kernel object id.
Find the child of an object by its kid.
Given a kernel object with children objects, obtain a handle to the child specified by the provided kernel object id.
Find the child of an object by its kid . Given a kernel object with children objects obtain a handle to the child specified by the provided kernel object id .
pub fn sys_object_get_child(
        &self,
        handle: HandleValue,
        koid: KoID,
        rights: u32,
        mut out: UserOutPtr<HandleValue>,
    ) -> ZxResult {
        info!(
            "object.get_child: handle={:#x}, koid={:#x}, rights={:#x}",
            handle, koid, rights
        );
        let mut rights = Rights::from_bits(rights).ok_or(ZxError::INVALID_ARGS)?;
        let proc = self.thread.proc();
        let (task, parent_rights) = proc.get_dyn_object_and_rights(handle)?;
        if !parent_rights.contains(Rights::ENUMERATE) {
            return Err(ZxError::ACCESS_DENIED);
        }
        if rights == Rights::SAME_RIGHTS {
            rights = parent_rights;
        } else if (rights & parent_rights) != rights {
            return Err(ZxError::ACCESS_DENIED);
        }
        let child = task.get_child(koid)?;
        let child_handle = proc.add_handle(Handle::new(child, rights));
        out.write(child_handle)?;
        Ok(())
    }
pub fn sys_object_get_child ( & self , handle : HandleValue , koid : KoID , rights : u32 , mut out : UserOutPtr < HandleValue > , ) -> ZxResult { info ! ( " " handle koid rights ) ; let mut rights = Rights :: from_bits ( rights ) . ok_or ( ZxError :: INVALID_ARGS ) ? ; let proc = self . thread . proc ( ) ; let ( task , parent_rights ) = proc . get_dyn_object_and_rights ( handle ) ? ; if ! parent_rights . contains ( Rights :: ENUMERATE ) { return Err ( ZxError :: ACCESS_DENIED ) ; } if rights == Rights :: SAME_RIGHTS { rights = parent_rights ; } else if ( rights & parent_rights ) != rights { return Err ( ZxError :: ACCESS_DENIED ) ; } let child = task . get_child ( koid ) ? ; let child_handle = proc . add_handle ( Handle :: new ( child , rights ) ) ; out . write ( child_handle ) ? ; Ok ( ( ) ) }
Find the child of an object by its kid.
Find the child of an object by its kid .
&self
handle
HandleValue
koid
KoID
rights
u32
out
UserOutPtr<HandleValue>
&self
handle
HandleValue
koid
KoID
rights
u32
out
UserOutPtr<HandleValue>