DOHOOKS(9)
β¨ DOHOOKS(9) from the Kernel Developerβs Manual β run all hooks, bestie β¨
π NAME π
dohooks β run all hooks in a list π
π¦ SYNOPSIS π¦
#include <sys/types.h>
#include <sys/systm.h>
void
dohooks(struct hook_desc_head *head, int flags);
π DESCRIPTION π
Okay so the dohooks() function literally invokes all the hooks established using the hook_establish(9) function. No cap. π«Ά
Hooks get called in the order of the TAILQ that head points to. But plot twist: hook_establish(9) can put the hooks either at the head or the tail of that queue, which makes it possible to call the hooks either in the order of establishment or its reverse. Iconic queue behavior, honestly. π₯
The flags can specify:
HOOK_REMOVEβ remove already processed hooks from the hook list π§ΉHOOK_FREEβ also free them π§
Lowkey important: in most cases you want either no flags at all, orHOOK_REMOVEandHOOK_FREEat the same time. JustHOOK_REMOVEwill drop the only reference to allocated memory, so it should only be used in situations where freeing memory would be illegal and unnecessary. Thatβs the rule, bestie β do not play with it. ππ
This function is used to implement the dostartuphooks(9) macro. Slay. β¨
π SEE ALSO π
Later, bestie π β this page is from Debian, dated December 12, 2015, and itβs literally DOHOOKS(9). Mwah! π«Άπ
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2001 Niklas Hallqvist
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms