QB_RB_OPEN(3)
β¨ QB_RB_OPEN β¨ β the libqb manual page, bestie edition π
okay so you want to make a ring buffer?? in shared memory?? say less, this is the function for you. it lives in the libqb programmer's manual, section 3 (library calls, iykyk) π
πΈ NAME πΈ
qb_rb_open β create the ring buffer with the given type. periodt. π
π¦ SYNOPSIS π¦
#include <qb/qbrb.h>
qb_ringbuffer_t * qb_rb_open(
const char *name, /* the unique name of this ringbuffer. */
size_t size, /* the requested size. */
uint32_t flags, /* or'ed flags */
size_t shared_user_data_size /* size for a shared data area. */
);
like... look at her. four args. iconic. π
π PARAMS π
nameβ the unique name of this ringbuffer. yes it has to be unique, no you can't just name it whatever twice, bestie πsizeβ the requested size. "requested" is doing a LOT of work in that sentence, we'll get to that πflagsβ or'ed flags. as in, bitwise-OR them together. stack 'em. π₯shared_user_data_sizeβ size for a shared data area. a lil extra scratch space you can share, cute π«Ά
π DESCRIPTION π
so basically this creates β and allocates β a ring buffer, and it does it in shared memory. that's the whole vibe. it's giving "several processes, one buffer, chaos but make it efficient" β¨
β RETURN VALUE β
you get back a shiny new ring buffer π ... OR NULL if there was a problem π
(if you got NULL, that's your sign. go check stuff. do not pass go.)
π NOTE π
the actual size will be rounded up to the next page size. so if you asked for a weird size, you're getting a page-aligned size instead. it's not lying to you, it's just... rounding up. main character energy fr fr π
π§ SEE ALSO π§
the whole girl gang, go read these too:
qb_rb_close(3)qb_rb_refcount_get(3)qb_rb_chmod(3)qb_rb_chown(3)qb_rb_write_to_file(3)qb_rb_create_from_file(3)qb_rb_chunks_used(3)qb_rb_chunk_reclaim(3)qb_rb_space_used(3)qb_rb_chunk_write(3)qb_rb_shared_user_data_get(3)qb_rb_chunk_commit(3)qb_rb_chunk_peek(3)qb_rb_space_free(3)qb_rb_name_get(3)qb_rb_chunk_alloc(3)qb_rb_chunk_read(3)
π COPYRIGHT π
Copyright (C) 2010-2020 Red Hat, Inc.
okay bestie that's the whole page, slay π this was the libqb manual, version dated 2025-09-16, brought to you by the libqb girlies at Red Hat π go forth and ring-buffer responsibly. mwah π bye!!
π¦ where this page comes from
- fedora 44: libqb-devel 2.0.9-2.fc44 Β· LGPL-2.1-or-later
- fedora 44: libqb-devel 2.0.9-2.fc44 Β· LGPL-2.1-or-later
- ubuntu resolute: libqb-dev 2.0.9-1ubuntu1 Β· LGPL-2.1-or-later
- ubuntu stonking: libqb-dev 2.0.9-1ubuntu1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms