TICKIT_WATCH_SIGNAL(3)
π tickit_watch_signal β bestie edition π
okay so this one lives in the Library Functions Manual (yes that's the manual name, we're fancy now) and it's literally about making your code go "omg a signal!!!" and do a little callback dance π
πΈ NAME πΈ
tickit_watch_signal β invoke a callback when a POSIX signal is raised β¨
π¦ SYNOPSIS π¦
#include <tickit.h>
typedef int TickitCallbackFn(Tickit *t, TickitEventflags flags,
void *info, void *user);
void *tickit_watch_signal(Tickit *t, int signum, TickitBindFlags flags,
TickitCallbackFn *fn, void *user);
Link with -ltickit. π«Ά
π DESCRIPTION π
so basically tickit_watch_signal() is the way you sign a callback function up to get pinged by the toplevel event loop whenever a POSIX signal gets received by the process. no cap. π‘
a registered callback gets invoked by a running call to tickit_run(3). and listen β the callback can get invoked more than once if the signal is received multiple times. it's giving "not me showing up again." π
the info pointer? it will be NULL. that's it, that's the tea. π
π multiple registrations, one signal (yes queen, you can stack them)
multiple registrations may be made for the same signal number. when that signal comes through, all of them get invoked, in the order they exist in the queue. so it's a whole little lineup. π
now here's the vibe check on ordering:
- if you registered with the
TICKIT_BIND_FIRSTflag, the callback gets inserted at the start of the queue, coming before the others. main character energy, front of the line. β - if not, it's appended at the end. no shame in that, still valid, still iconic. π
π what happens if you cancel
if it gets cancelled by tickit_watch_cancel(3), the callback function is invoked with just the TICKIT_EV_UNBIND flag β but only if it had been registered with TICKIT_BIND_UNBIND. otherwise, nothing. don't @ me, that's just how it works. π
β¨ RETURN VALUE β¨
tickit_watch_signal() returns an opaque identifier pointer. yep. opaque. mysterious. we love a secretive little guy. π₯
π SEE ALSO π
tickit_new_stdio(3)tickit_watch_io(3)tickit_watch_timer_after_msec(3)tickit_watch_timer_at_epoch(3)tickit_watch_later(3)tickit_watch_process(3)tickit_watch_cancel(3)tickit(7)
and that's the whole page bestie!! πΈ this was TICKIT_WATCH_SIGNAL(3) from the Library Functions Manual, and yeah it's got that same TICKIT_WATCH_SIGNAL(3) energy at the bottom too. go raise some signals responsibly. mwah π
β¨
π¦ where this page comes from
- alpine 3.24: libtickit-doc 0.4.6-r0 Β· MIT
- debian bookworm: libtickit-dev 0.4.3-1 Β· MIT
- debian trixie: libtickit-dev 0.4.3-2 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- nixos 26.05: libtickit 0.4.5
- nixpkgs unstable: libtickit 0.4.6
- ubuntu noble: libtickit-dev 0.4.3-1.1build1 Β· MIT
- ubuntu questing: libtickit-dev 0.4.3-2
- ubuntu resolute: libtickit-dev 0.4.3-2build1 Β· MIT
- ubuntu stonking: libtickit-dev 0.4.3-2build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms