|HOOK_ESTABLISH(9)||Kernel Developer's Manual||HOOK_ESTABLISH(9)|
hook_desc_head *head, int
tail, void (*fn)(void
*), void *arg);
hook_establish() function adds fn to the list of hooks invoked by dohooks(9). If tail is non-zero, the hook is added to the tail of the list denoted by the TAILQ_HEAD pointer head, otherwise to the front. The dohooks(9) function will at its invocation call each hook from the front of this list. When invoked, the hook function fn will be passed arg as its only argument.
hook_disestablish() function removes
the hook described by the opaque pointer cookie from
the list of hooks denoted by the TAILQ_HEAD pointer
head. If cookie is invalid, the
hook_disestablish() is undefined.
The startup and mountroot systems use this API for their implementation.
hook_establish() returns an opaque pointer describing the newly established hook. Otherwise, it returns
|December 12, 2015||OpenBSD-current|