pub fn read_from_cq(&mut self) -> Result<(i32, u64), UringError> {
        // Load current head
        let mut head = unsafe { &*self.cring_head }.load(Ordering::Acquire);

        // If head == tail the buffer is empty
        checkerr!(head == unsafe { *self.cring_tail }, UringError::ReadFromCqEmptyBuffer);

        // Get CQE entry
        let cqe = unsafe { &*self.cqes.offset((head & (*self.cring_mask)) as isize) };

        // Save data so we can return it
        let res = cqe.res;
        let user_data = cqe.user_data;

        // Increase head and save it
        head += 1;
        unsafe { &*self.cring_head }.store(head, Ordering::Release);


        // Keep track of how many CQEs we've read
        self.read_total += 1;

        // Result, user_data
        //Ok((res, user_pid, user_smaps))
        Ok((res, user_data))
    }
// Read next item from the completion queue
Read next item from the completion queue
Read next item from the completion queue
pub fn read_from_cq(&mut self) -> Result<(i32, u64), UringError> {
        // Load current head
        let mut head = unsafe { &*self.cring_head }.load(Ordering::Acquire);
        // If head == tail the buffer is empty
        checkerr!(head == unsafe { *self.cring_tail }, UringError::ReadFromCqEmptyBuffer);
        // Get CQE entry
        let cqe = unsafe { &*self.cqes.offset((head & (*self.cring_mask)) as isize) };
        // Save data so we can return it
        let res = cqe.res;
        let user_data = cqe.user_data;
        // Increase head and save it
        head += 1;
        unsafe { &*self.cring_head }.store(head, Ordering::Release);
        // Keep track of how many CQEs we've read
        self.read_total += 1;
        // Result, user_data
        //Ok((res, user_pid, user_smaps))
        Ok((res, user_data))
    }
pub fn read_from_cq ( & mut self ) -> Result < ( i32 , u64 ) , UringError > { // Load current head let mut head = unsafe { & * self . cring_head } . load ( Ordering :: Acquire ) ; // If head == tail the buffer is empty checkerr ! ( head unsafe { self cring_tail } UringError ReadFromCqEmptyBuffer ) ; // Get CQE entry let cqe = unsafe { & * self . cqes . offset ( ( head & ( * self . cring_mask ) ) as isize ) } ; // Save data so we can return it let res = cqe . res ; let user_data = cqe . user_data ; // Increase head and save it head += 1 ; unsafe { & * self . cring_head } . store ( head , Ordering :: Release ) ; // Keep track of how many CQEs we've read self . read_total += 1 ; // Result, user_data //Ok((res, user_pid, user_smaps)) Ok ( ( res , user_data ) ) }
Read next item from the completion queue
Read next item from the completion queue
&mut self