TICKIT_WATCH_PROCESS(3)
π TICKIT_WATCH_PROCESS(3) π
okay bestie, so this is a page from the Library Functions Manual and it's literally called tickit_watch_process and it is SO useful, lemme tell you everything π«Ά
β¨ NAME β¨
tickit_watch_process β invoke a callback when a child process terminates
like. it watches your kid process. and when the kid process β¨departs this mortal coilβ¨ it runs your function. no cap.
πΈ SYNOPSIS πΈ
#include <tickit.h>
typedef struct {
pid_t pid;
int wstatus;
} TickitProcessWatchInfo;
typedef int TickitCallbackFn(Tickit *t, TickitEventflags flags,
void *info, void *user);
void *tickit_watch_process(Tickit *t, pid_t pid, TickitBindFlags flags,
TickitCallbackFn *fn, void *user);
Link with -ltickit.
not me dropping the exact struct and typedef up there β copy them character for character, bestie, do NOT freestyle this part π
π¦ DESCRIPTION π¦
tickit_watch_process() registers a callback function that the toplevel event loop will invoke when a child process terminates. so like, you hand over a function, and the moment that process is done-done, the loop calls it. iconic behaviour, honestly.
A registered callback gets invoked by a running call to tickit_run(3). and the info pointer? it points to a structure holding the process PID and the exit status. so you get the receipts. πβ¨
If you registered with the TICKIT_BIND_FIRST flag, your callback gets inserted at the start of the queue β coming before the others, main character energy, front of the line π. If you didn't use that flag, it just gets appended at the end. lowkey humbling but fine.
If the whole thing 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. that's the deal, that's the contract, no notes. π
π RETURN VALUE π
tickit_watch_process() returns an opaque identifier pointer. it's giving "here's a little token, don't ask what's inside" π
π 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_signal(3)tickit_watch_cancel(3)tickit(7)
and that's the whole page, bestie!! π this was TICKIT_WATCH_PROCESS(3) from the Library Functions Manual β go forth and watch those processes, you absolute legend βπ¦π
π¦ 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