CDDL HEADER START
The contents of this file are subject to the terms of the
Common Development and Distribution License (the "License").
You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
or http://www.opensolaris.org/os/licensing.
See the License for the specific language governing permissions
and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each
file and include the License file at usr/src/OPENSOLARIS.LICENSE.
If applicable, add the following below this CDDL HEADER, with the
fields enclosed by brackets "[]" replaced with your own identifying
information: Portions Copyright [yyyy] [name of copyright owner]
CDDL HEADER END
Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
void* address, unsigned long len, sigsegv_area_handler_t handler, void* handler_arg);
void* ticket);
void* fault_address);
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 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.
typedef struct sigsegv_dispatcher {
void* tree;
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);
The handler_arg is the second argument of the sigsegv_area_handler_t.
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(7), sigsegv(3), standards(7)