9330 stack overflow when creating a deeply nested dataset
[unleashed.git] / usr / src / man / man3c / siginterrupt.3c
blob0cfffd3b22a62f02759597640e6dcce3a270c6d3
1 '\" te
2 .\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH SIGINTERRUPT 3C "Sep 1, 2003"
7 .SH NAME
8 siginterrupt \- allow signals to interrupt functions
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <signal.h>
14 \fBint\fR \fBsiginterrupt\fR(\fBint\fR \fIsig\fR, \fBint\fR \fIflag\fR);
15 .fi
17 .SH DESCRIPTION
18 .sp
19 .LP
20 The \fBsiginterrupt()\fR function changes the restart behavior when a function
21 is interrupted by the specified signal. The function
22 \fBsiginterrupt\fR(\fIsig\fR, \fIflag\fR) has an effect as if implemented as:
23 .sp
24 .in +2
25 .nf
26 siginterrupt(int sig, int flag) {
27      int ret;
28      struct sigaction act;
29      (void) sigaction(sig, NULL, &act);
30      if (flag)
31           act.sa_flags &=  SA_RESTART;
32      else
33           act.sa_flags |= SA_RESTART;
34      ret = sigaction(sig, &act, NULL);
35      return ret;
37 .fi
38 .in -2
40 .SH RETURN VALUES
41 .sp
42 .LP
43 Upon successful completion, \fBsiginterrupt()\fR returns 0. Otherwise, \(mi1 is
44 returned and \fBerrno\fR is set to indicate the error.
45 .SH ERRORS
46 .sp
47 .LP
48 The \fBsiginterrupt()\fR function will fail if:
49 .sp
50 .ne 2
51 .na
52 \fB\fBEINVAL\fR\fR
53 .ad
54 .RS 10n
55 The \fIsig\fR argument is not a valid signal number.
56 .RE
58 .SH USAGE
59 .sp
60 .LP
61 The \fBsiginterrupt()\fR function supports programs written to historical
62 system interfaces. A standard-conforming application, when being written or
63 rewritten, should use \fBsigaction\fR(2) with the \fBSA_RESTART\fR flag instead
64 of \fBsiginterrupt()\fR.
65 .SH ATTRIBUTES
66 .sp
67 .LP
68 See \fBattributes\fR(5) for descriptions of the following attributes:
69 .sp
71 .sp
72 .TS
73 box;
74 c | c
75 l | l .
76 ATTRIBUTE TYPE  ATTRIBUTE VALUE
78 Interface Stability     Standard
80 MT-Level        MT-Safe
81 .TE
83 .SH SEE ALSO
84 .sp
85 .LP
86 \fBsigaction\fR(2), \fBsignal.h\fR(3HEAD), \fBattributes\fR(5),
87 \fBstandards\fR(5)