shutdownhook_establish man page on NetBSD

Man page or keyword search:  
man Server   9087 pages
apropos Keyword Search (all sections)
Output format
NetBSD logo
[printable version]

SHUTDOWNHOOK_ESTABLIS... BSD Kernel Developer's ManualSHUTDOWNHOOK_ESTABLIS...

NAME
     shutdownhook_establish, shutdownhook_disestablish — add or remove a shut‐
     down hook

SYNOPSIS
     void *
     shutdownhook_establish(void (*fn)(void *), void *arg);

     void
     shutdownhook_disestablish(void *cookie);

DESCRIPTION
     The shutdownhook_establish API is deprecated.

     The shutdownhook_establish() function adds fn to the list of hooks
     invoked by doshutdownhooks(9) at shutdown.	 When invoked, the hook func‐
     tion fn will be passed arg as its only argument.

     The shutdownhook_disestablish() function removes the hook described by
     the opaque pointer cookie from the list of hooks to be invoked at shut‐
     down.  If cookie is invalid, the result of shutdownhook_disestablish() is
     undefined.

     Shutdown hooks should be used to perform one-time activities that must
     happen immediately before the kernel exits.  Because of the environment
     in which they are run, shutdown hooks cannot rely on many system services
     (including file systems, and timeouts and other interrupt-driven ser‐
     vices), or even basic system integrity (because the system could be
     rebooting after a crash).

RETURN VALUES
     If successful, shutdownhook_establish() returns an opaque pointer
     describing the newly-established shutdown hook.  Otherwise, it returns
     NULL.

EXAMPLES
     It may be appropriate to use a shutdown hook to disable a device that
     does direct memory access, so that the device will not try to access mem‐
     ory while the system is rebooting.

     It may be appropriate to use a shutdown hook to inform watchdog timer
     hardware that the operating system is no longer running.

SEE ALSO
     doshutdownhooks(9)

BUGS
     The names are clumsy, at best.

BSD				 May 14, 2009				   BSD
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server NetBSD

List of man pages available for NetBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net