startuphook_establish, startuphook_disestablish - add or remove a startup
startuphook_establish(void (*fn)(void *), void *arg);
The startuphook_establish() function adds fn to the list of
by dostartuphooks(9) at startup. When invoked, the hook
function fn will
be passed arg as its only argument.
The startuphook_disestablish() function removes the hook described by the
opaque pointer cookie from the list of hooks to be invoked
If cookie is invalid, the result of
startuphook_disestablish() is undefined.
Startup hooks should be used to perform one-time activities
happen immediately before the root and swap devices are configured, but
after normal device autoconfiguration.
Startup hooks are, like shutdown hooks, implemented via the
If successful, startuphook_establish() returns an opaque
the newly established startup hook. Otherwise, it returns NULL.
It may be appropriate to use a startup hook to provide potential root or
swap devices that have delayed configuration. The iop(4)
shows an example
of this usage.
dohooks(9), doshutdownhooks(9), dostartuphooks(9)
The names are clumsy, at best.
OpenBSD 3.6 July 27, 2001
[ Back ]