QB_LOOP_SIGNAL_ADD(3)
π QB_LOOP_SIGNAL_ADD β bestie edition π
okay so this is a page from the libqb Programmer's Manual, and today's main character is qb_loop_signal_add(3). yes, it's a libqb thing. yes, it's gonna be fun. come with me π«Ά
β¨ NAME β¨
qb_loop_signal_add β Add a signal job.
like. that's the whole vibe. it adds a signal job. iconic behaviour honestly πΈ
β¨ SYNOPSIS β¨
#include <qb/qbloop.h>
int32_t qb_loop_signal_add(
qb_loop_t *l, /* pointer to the loop instance */
enum qb_loop_priority p, /* the priority */
int32_t sig, /* (SIGHUP or SIGINT) etc .... */
void *data, /* user data passed into the dispatch function */
qb_loop_signal_dispatch_fn dispatch_fn, /* callback function */
qb_loop_signal_handle *handle /* (out) a reference to the signal job */
);
no cap, that's the exact signature, copy it character for character and don't be cute with it π
β¨ PARAMS β¨
the whole squad of arguments, one by one:
lβ pointer to the loop instance. it's your loop, bestie, you gotta bring it.pβ the priority. that's theenum qb_loop_prioritysituation (more on that below π).sigβ the signal.(SIGHUP or SIGINT) etc ....so like, those ones. or others. the etc is doing a lot of heavy lifting there but we respect it.dataβ user data passed into the dispatch function. it's your lil parcel of vibes that gets handed to the callback πdispatch_fnβ callback function. the thing that actually goes off.handleβ(out)a reference to the signal job. it's an out-param, so it's giving back to you, not taking. so generous of it π«Ά
β¨ DESCRIPTION β¨
Get a callback on this signal (not in the context of the signal).
that "not in the context of the signal" part is lowkey the whole point, so don't skim it. the callback doesn't run inside the signal handler's context β it gets dispatched through the loop instead. slay, safe, we love to see it β¨
β¨ STRUCTURES β¨
here's the priority enum, verbatim, no edits:
enum qb_loop_priority {
QB_LOOP_LOW;
QB_LOOP_MED;
QB_LOOP_HIGH;
};
three tiers. low, med, high. pick your fighter π₯
β¨ RETURN VALUE β¨
status (0 == ok, -errno == failure)
so: 0? you ate. -errno? not the vibe. check it, bestie π
β¨ SEE ALSO β¨
the whole friend group, all of them, no one left behind:
qb_loop_job_del(3)qb_loop_run(3)qb_loop_create(3)qb_loop_stop(3)qb_loop_poll_low_fds_event_set(3)qb_loop_signal_del(3)qb_loop_job_add(3)qb_loop_poll_del(3)qb_loop_destroy(3)qb_loop_timer_expire_time_remaining(3)qb_loop_poll_mod(3)qb_loop_signal_mod(3)qb_loop_timer_del(3)qb_loop_timer_add(3)qb_loop_timer_is_running(3)qb_loop_timer_expire_time_get(3)qb_loop_poll_add(3)
β¨ COPYRIGHT β¨
Copyright (C) 2010-2020 Red Hat, Inc.
fr fr, that's the whole page. every flag, every param, every reference, all present and accounted for. nothing skipped, nothing invented π
okay bye bestie, go handle those signals responsibly. this page is from libqb, dated 2025-09-16, and it's the QB_LOOP_SIGNAL_ADD(3) moment. periodt π
ππ
π¦ 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