QB_LOOP_POLL_ADD(3)
β¨ QB_LOOP_POLL_ADD β¨
okay so bestie, we're in the libqb Programmer's Manual and this page is literally called qb_loop_poll_add π
it lives in section 3 (that's the library-functions girlies, iykyk) so go ahead and pull up a chair π
πΈ NAME πΈ
qb_loop_poll_add β add a poll job to the mainloop. that's it, that's the whole vibe π¦
π SYNOPSIS π
#include <qb/qbloop.h>
int32_t qb_loop_poll_add(
qb_loop_t *l, /* pointer to the loop instance */
enum qb_loop_priority p, /* the priority */
int32_t fd, /* file descriptor. */
int32_t events, /* (POLLIN|POLLOUT) etc .... */
void *data, /* user data passed into the dispatch function */
qb_loop_poll_dispatch_fn dispatch_fn /* callback function */
);
no cap, that's the whole signature π include the header, call the function, slay.
π§ PARAMS π§
so here's who's showing up to the function call, one by one:
lβ pointer to the loop instance. your main character loop, fr fr.pβ the priority. lowkey, med, or highkey. (see STRUCTURES below π)fdβ file descriptor.eventsβ(POLLIN|POLLOUT)etc .... yes, you can or them together, that's the whole point π«Άdataβ user data passed into the dispatch function. your little gift bag for the callback πdispatch_fnβ callback function. the one who actually does the thing when the poll fires π
π DESCRIPTION π
literally what it says on the tin, bestie β you're handing the mainloop a poll job. β¨
π¦ STRUCTURES π¦
the priority enum, in all her glory:
enum qb_loop_priority {
QB_LOOP_LOW;
QB_LOOP_MED;
QB_LOOP_HIGH;
};
three tiers, three moods, pick your fighter π
β RETURN VALUE β
status (0 == ok, -errno == failure)
so like, 0 is the good ending, and a negative errno is the "not me crying in the group chat" ending π
π₯ NOTE π₯
it is a re-occurring job. so don't come crying to me when it fires again, bestie β that's the assignment π«Ά
π SEE ALSO π
the whole friend group, go read them too:
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_signal_add(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),
π COPYRIGHT π
Copyright (C) 2010-2020 Red Hat, Inc.
okay that's the page!! π this was LIBQB, dated 2025-09-16, and the manual page is QB_LOOP_POLL_ADD(3) β go forth and poll responsibly, bestie, 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