QB_RB_CHUNK_READ(3)

πŸ’– QB_RB_CHUNK_READ πŸ’–

okay so this lil gem lives in the libqb Programmer's Manual, section 3 (the library-functions girlies, iykyk) πŸ’…


🌸 NAME 🌸

qb_rb_chunk_read β€” read the oldest chunk into data_out. that's the whole job, no cap ✨


πŸ“œ SYNOPSIS πŸ“œ

#include <qb/qbrb.h>

ssize_t qb_rb_chunk_read(
    qb_ringbuffer_t   *rb,          /* ringbuffer instance */
    void              *data_out,    /* (in/out) the chunk will be memcpy'ed into this. */
    size_t             len,         /* (in) the size of data_out. */
    int32_t            ms_timeout   /* the amount od time to wait for new data. */
);

🫢 PARAMS 🫢

  • rb β€” your ringbuffer instance. the main character of this whole situation πŸ‘‘
  • data_out β€” (in/out) the chunk gets memcpy'ed into this. it's giving "bring your own buffer" fr fr
  • len β€” (in) the size of data_out. know your limits bestie πŸ’–
  • ms_timeout β€” how long to wait for new data. patience is a virtue, but only for that many ms ⏳

🌈 DESCRIPTION 🌈

so bestie, this one is literally the same as qb_rb_chunk_peek(), memcpy(), and qb_rb_chunk_reclaim() β€” the combo meal of ringbuffer reading πŸ“ like, it peeks at the oldest chunk, copies it into your buffer, and reclaims it. all three vibes, one function call, slay ✨


⭐ RETURN VALUE ⭐

the size of the chunk, or error. periodt πŸ’…

heads up: if it comes back as an error, that's your signal that something did not go off without a hitch. don't ignore it 🚨

πŸ‘‘ SEE ALSO πŸ‘‘


Copyright (C) 2010-2020 Red Hat, Inc.


and that's the whole page, bestie!! πŸ¦‹ this one's tagged LIBQB, dated 2025-09-16, and yes it still says QB_RB_CHUNK_READ(3) in the corner πŸŽ€ go forth and read your chunks, you absolute icon πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from