Introduction to Library Functions sigsegv_register(3) NAME sigsegv_init, sigsegv_register, sigsegv_unregister, sigsegv_dispatch - LOCAL SIGSEGV HANDLERS SYNOPSIS #include void sigsegv_init (sigsegv_dispatcher* dispatcher); void* sigsegv_register (sigsegv_dispatcher* dispatcher, void* address, unsigned long len, sigsegv_area_handler_t handler, void* handler_arg); void sigsegv_unregister (sigsegv_dispatcher* dispatcher, void* ticket); int sigsegv_dispatch (sigsegv_dispatcher* dispatcher, void* fault_address); DESCRIPTION The set of functions permit to define different SIGSEGV pol- icies on different address ranges. Sigsegv_init initializes a sigsegv_dispatcher structure. Sigsegv_register adds a local SIGSEGV handler to a sigsegv_dispatcher structure. It will cover the interval [address..address+len-1]. Returns a "ticket" that can be used to remove the handler later. Sigsegv_unregister removes a local SIGSEGV handler. Sigsegv_dispatch call the local SIGSEGV handler responsible for the given fault address. Return the handler's return value. 0 means that no handler has been found, or that a handler was found but declined responsibility. OPERANDS typedef struct sigsegv_dispatcher { void* tree; }sigsegv_dispatcher; SunOS 5.11 Last change: 13 Jan 2009 1 Introduction to Library Functions sigsegv_register(3) Sigsegv_dispatcher represents a table of memory areas (address range intervals), with an local SIGSEGV handler for each. The address represents the address of the memory area, and the len represents the length of the memory area. typedef int (*sigsegv_area_handler_t) (void* fault_address, void* user_arg); sigsegv_area_handler_t is the type of a local SIGSEGV handler. The fault address is passed as argument. The second argument is fixed arbitrary user data. The return value should be nonzero if the handler has done its job and no other handler should be called, or 0 if the handler declines responsibility for the given address. The handler_arg is the second argument of the sigsegv_area_handler_t. EXIT STATUS Sigsegv_dispatcher returns the handler's return value. 0 means that no handler has been found, or that a handler was found but declined responsibility. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWlibsigsegv | |_____________________________|_____________________________| | Interface Stability | Uncommitted | |_____________________________|_____________________________| | Standard | See standards(5). | |_____________________________|_____________________________| SEE ALSO attributes(5), sigsegv(3), standards(5) NOTES The libsigsegv project is located at http://libsigsegv.sourceforge.net. SunOS 5.11 Last change: 13 Jan 2009 2 Introduction to Library Functions sigsegv_register(3) Source for libsigsegv is available on http://opensolaris.org. SunOS 5.11 Last change: 13 Jan 2009 3