*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> hook_disestablish (9)              
Title
Content
Arch
Section
 

HOOK_ESTABLISH(9)

Contents


NAME    [Toc]    [Back]

     hook_establish, hook_disestablish - add  or  remove  a  hook
from a specified
     list

SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>
     #include <sys/systm.h>

     void *
     hook_establish(struct  hook_desc_head  *head, int tail, void
(*fn)(void *),
             void *arg);

     void
     hook_disestablish(struct    hook_desc_head    *head,    void
*cookie);

DESCRIPTION    [Toc]    [Back]

     The  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.

     The 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    result    of
hook_disestablish() is undefined.


     Both the startup- and shutdownhooks systems use this API for
their implementation.

RETURN VALUES    [Toc]    [Back]

     If successful, hook_establish() returns  an  opaque  pointer
describing the
     newly established hook.  Otherwise, it returns NULL.

SEE ALSO    [Toc]    [Back]

      
      
     dohooks(9), doshutdownhooks(9), dostartuphooks(9),
     shutdownhook_establish(9), startuphook_establish(9)

OpenBSD      3.6                           July      27,     2001
[ Back ]
 Similar pages
Name OS Title
shutdownhook_establish NetBSD add or remove a shutdown hook
startuphook_establish OpenBSD add or remove a startup hook
startuphook_disestablish OpenBSD add or remove a startup hook
powerhook_disestablish OpenBSD add or remove a power hook
shutdownhook_establish OpenBSD add or remove a shutdown hook
shutdownhook_disestablish NetBSD add or remove a shutdown hook
powerhook_establish OpenBSD add or remove a power hook
shutdownhook_disestablish OpenBSD add or remove a shutdown hook
powerhook_disestablish NetBSD add or remove a power change hook
powerhook_establish NetBSD add or remove a power change hook
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service