sigsegv_init - LOCAL SIGSEGV HANDLERS
#include <sigsegv.h> void sigsegv_init (sigsegv_dispatcher* dispatcher); void* sigsegv_register (sigsegv_dispatcher* dispatcher, void* address, size_t len, sigsegv_area_han- dler_t handler, void* handler_arg); void sigsegv_unregister (sigsegv_dispatcher* dispatcher, void* ticket); int sigsegv_dispatch (sigsegv_dispatcher* dispatcher, void* fault_address);
sigsegv_register(3) Library Functions Manual sigsegv_register(3) NAME sigsegv_init, sigsegv_register, sigsegv_unregister, sigsegv_dispatch - LOCAL SIGSEGV HANDLERS SYNOPSIS #include <sigsegv.h> void sigsegv_init (sigsegv_dispatcher* dispatcher); void* sigsegv_register (sigsegv_dispatcher* dispatcher, void* address, size_t len, sigsegv_area_han- dler_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 policies 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 calls 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; 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 rep- resents the length of the memory area. Both must be a multiple of SIGSEGV_FAULT_ADDRESS_ALIGNMENT. 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 the first argument. The second argument are 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. COPYRIGHT Copyright 1998-1999, 2002-2012, 2016-2021 Bruno Haible <bruno@clisp.org> Copyright 2002-2005, 2009 Paolo Bonzini <bonzini@gnu.org> Copyright 2008-2010 Eric Blake <ebb9@byu.net> Copyright 2002-2021 Free Software Foundation, Inc. GNU libsigsegv library and manual pages are licensed under GNU GPL ver- sion 2 or later <https://gnu.org/licenses/gpl-2.0.html>. This is free software: you are free to change and redistribute it. There is NO WAR- RANTY, to the extent permitted by law. ATTRIBUTES See attributes(7) for descriptions of the following attributes: +---------------+--------------------+ |ATTRIBUTE TYPE | ATTRIBUTE VALUE | +---------------+--------------------+ |Availability | library/libsigsegv | +---------------+--------------------+ |Stability | Uncommitted | +---------------+--------------------+ SEE ALSO attributes(7), sigsegv(3), standards(7) NOTES Source code for open source software components in Oracle Solaris can be found at https://www.oracle.com/downloads/opensource/solaris-source- code-downloads.html. This software was built from source available at https://github.com/oracle/solaris-userland. The original community source was downloaded from https://ftp.gnu.org/gnu/libsigsegv/lib- sigsegv-2.13.tar.gz. Further information about this software can be found on the open source community website at https://www.gnu.org/software/libsigsegv. Solaris 11.4 17 June 2021 sigsegv_register(3)