usr/src/lib/libsigsegv/sigsegv.3
changeset 0 b34509ac961f
child 11 87960ed158f9
equal deleted inserted replaced
-1:000000000000 0:b34509ac961f
       
     1 '\" te
       
     2 .\"
       
     3 .\" CDDL HEADER START
       
     4 .\"
       
     5 .\" The contents of this file are subject to the terms of the
       
     6 .\" Common Development and Distribution License (the "License").
       
     7 .\" You may not use this file except in compliance with the License.
       
     8 .\"
       
     9 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
       
    10 .\" or http://www.opensolaris.org/os/licensing.
       
    11 .\" See the License for the specific language governing permissions
       
    12 .\" and limitations under the License.
       
    13 .\"
       
    14 .\" When distributing Covered Code, include this CDDL HEADER in each
       
    15 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
       
    16 .\" If applicable, add the following below this CDDL HEADER, with the
       
    17 .\" fields enclosed by brackets "[]" replaced with your own identifying
       
    18 .\" information: Portions Copyright [yyyy] [name of copyright owner]
       
    19 .\"
       
    20 .\" CDDL HEADER END
       
    21 .\"
       
    22 .\" Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
       
    23 .\" Use is subject to license terms.
       
    24 .\"
       
    25 .\" ident	"@(#)sigsegv.3	1.1	09/03/05 SMI"
       
    26 .\"
       
    27 .TH SIGSEGV 3 "13 Jan 2009" "SunOS 5.11"
       
    28 .SH NAME
       
    29 sigsegv  \-  Handling page faults in user mode
       
    30 .sp
       
    31 .SH SYNOPSIS
       
    32 .sp
       
    33 #include <\fBsigsegv.h\fR>
       
    34 .sp
       
    35 .SH DESCRIPTION
       
    36 .sp
       
    37 .LP
       
    38 Sigsegv is a set of functions for handling page faults in user mode. Multithreading is used to improve the performance of a program.A page fault occurs when a program tries to access to a region of memory that is currently not available. Catching and handling a page fault is a useful technique for implementing:
       
    39 .RS +4
       
    40 .TP
       
    41 .ie t \(bu
       
    42 .el o
       
    43 pageable virtual memory
       
    44 .RE
       
    45 .RS +4
       
    46 .TP
       
    47 .ie t \(bu
       
    48 .el o
       
    49 memory-mapped access to persistent databases
       
    50 .RE
       
    51 .RS +4
       
    52 .TP
       
    53 .ie t \(bu
       
    54 .el o
       
    55 generational garbage collectors
       
    56 .RE
       
    57 .RS +4
       
    58 .TP
       
    59 .ie t \(bu
       
    60 .el o
       
    61 stack overflow handlers
       
    62 .RE
       
    63 .RS +4
       
    64 .TP
       
    65 .ie t \(bu
       
    66 .el o
       
    67 distributed shared memory
       
    68 .RE
       
    69 .RS +4
       
    70 .TP
       
    71 .ie t \(bu
       
    72 .el o
       
    73  ...
       
    74 .RE
       
    75 .sp
       
    76 .LP  
       
    77 The sigsegv functions are summarized in this section in the following
       
    78 groups:
       
    79 .sp
       
    80 .RS +4
       
    81 .TP
       
    82 .ie t \(bu
       
    83 .el o  
       
    84 Global SIGSEGV handlers
       
    85 .RE
       
    86 .RS +4
       
    87 .TP
       
    88 .ie t \(bu
       
    89 .el o
       
    90 Local SIGSEGV handlers (a handler per memory area)
       
    91 .RE
       
    92 .RS +4
       
    93 .TP
       
    94 .ie t \(bu
       
    95 .el o
       
    96 Stack overflow handlers
       
    97 .RE
       
    98 .sp
       
    99 .LP
       
   100 The <sigsegv.h> header defines the following symbols:
       
   101 .sp
       
   102 .RS +4
       
   103 .TP
       
   104 .ie t \(bu
       
   105 .el o
       
   106 HAVE_SIGSEGV_RECOVERY
       
   107 .RE
       
   108 .RS +4
       
   109 .TP
       
   110 .ie t \(bu
       
   111 .el o
       
   112 HAVE_STACK_OVERFLOW_RECOVERY
       
   113 .RE
       
   114 .RS +4
       
   115 .TP
       
   116 .ie t \(bu
       
   117 .el o
       
   118 LIBSIGSEGV_VERSION
       
   119 .RE
       
   120 .sp
       
   121 .LP
       
   122 The types listed below are defined as described in <sigsegv.h>:
       
   123 .RS +4
       
   124 .TP
       
   125 .ie t \(bu
       
   126 .el o
       
   127 sigsegv_handler_t
       
   128 .RE
       
   129 .RS +4
       
   130 .TP
       
   131 .ie t \(bu
       
   132 .el o
       
   133 sigsegv_handler_t
       
   134 .RE
       
   135 .RS +4
       
   136 .TP
       
   137 .ie t \(bu
       
   138 .el o
       
   139 stackoverflow_context_t
       
   140 .RE
       
   141 .RS +4
       
   142 .TP
       
   143 .ie t \(bu
       
   144 .el o
       
   145 sigsegv_area_handler_t
       
   146 .RE
       
   147 .sp
       
   148 .SH GLOBAL SIGSEGV HANDLERS
       
   149 .sp
       
   150 int \fBsigsegv_install_handler\fR (sigsegv_handler_t handler);
       
   151 .sp
       
   152 void \fBsigsegv_deinstall_handler\fR (void);
       
   153 .sp
       
   154 .SH LOCAL SIGSEGV HANDLERS
       
   155 .sp
       
   156 void \fBsigsegv_init\fR (sigsegv_dispatcher* dispatcher);
       
   157 .sp
       
   158 void* \fBsigsegv_register\fR (sigsegv_dispatcher* dispatcher,
       
   159 .RS +24
       
   160 void* address, unsigned long len, 
       
   161 sigsegv_area_handler_t handler,
       
   162 void* handler_arg);
       
   163 .RE
       
   164 .sp
       
   165 void \fBsigsegv_unregister\fR (sigsegv_dispatcher* dispatcher, 
       
   166 .RS +25
       
   167 void* ticket);
       
   168 .RE
       
   169 .sp
       
   170 int \fBsigsegv_dispatch\fR (sigsegv_dispatcher* dispatcher, 
       
   171 .RS +22
       
   172 void* fault_address);
       
   173 .RE
       
   174 .sp
       
   175 .SH STACK OVERFLOW HANDLERS
       
   176 .sp
       
   177 int \fBstackoverflow_install_handler\fR (stackoverflow_handler_t
       
   178 .RS +27
       
   179 handler, void* extra_stack,
       
   180 unsigned long extra_stack_size);
       
   181 .RE
       
   182 .sp
       
   183 void \fBstackoverflow_deinstall_handler\fR (void);
       
   184 .sp
       
   185 .SH ATTRIBUTES
       
   186 See
       
   187 .BR attributes(5)
       
   188 for descriptions of the  following  attributes:
       
   189 .sp
       
   190 .TS
       
   191 tab() box;
       
   192 cw(2.75i) |cw(2.75i) 
       
   193 lw(2.75i) |lw(2.75i) 
       
   194 .
       
   195 ATTRIBUTE TYPEATTRIBUTE VALUE
       
   196 _
       
   197 AvailabilitySUNWlibsigsegv
       
   198 _
       
   199 Interface StabilityUncommitted
       
   200 _
       
   201 StandardSee \fBstandards\fR(5).
       
   202 .TE
       
   203 
       
   204 .SH SEE ALSO
       
   205 .sp
       
   206 .LP
       
   207 \fBattributes\fR(5), \fBsigsegv\fR(3), \fBstandards\fR(5), \fBsigsegv_install_handler, \fBsigsegv_deinstall_handler\fR(3), \fBsigsegv_init\fR(3), \fBsigsegv_register\fR(3), \fBsigsegv_unregister\fR(3), \fBsigsegv_dispatch\fR(3), \fBstackoverflow_install_handler\fR(3), \fBstackoverflow_deinstall_handler\fR(3)
       
   208 
       
   209 .SH NOTES
       
   210 The libsigsegv project is located at http://libsigsegv.sourceforge.net.
       
   211 .sp
       
   212 Source for libsigsegv is available on http://opensolaris.org.