1 .\" Written by Michael Haardt, Fri Nov 25 14:51:42 MET 1994
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 .\" GNU General Public License for more details.
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
23 .\" Added siglongjmp, Sun Mar 2 22:03:05 EST 1997, jrv@vanzandt.mv.com
24 .\" Modifications, Sun Feb 26 14:39:45 1995, faith@cs.unc.edu
26 .\" Japanese Version Copyright (c) 1998 Seiiti Obara
27 .\" all rights reserved.
28 .\" Translated 1998-05-27, Seiiti Obara <SEO@ma1.seikyou.ne.jp>
29 .\" Updated 2009-02-24, Akihiro MOTOKI, LDP v3.19
31 .\"WORD: stack context スタックコンテキスト
32 .\"WORD: signal masks シグナルマスク
33 .\"WORD: signal context シグナルコンテキスト
35 .\"WORD: low-level 低レベル
37 .TH LONGJMP 3 2009-01-13 "" "Linux Programmer's Manual"
40 .\"O longjmp, siglongjmp \- nonlocal jump to a saved stack context
41 longjmp, siglongjmp \- 保存されたスタックコンテキスト (stack context)
46 .B #include <setjmp.h>
48 .BI "void longjmp(jmp_buf " env ", int " val );
50 .BI "void siglongjmp(sigjmp_buf " env ", int " val );
54 .\"O Feature Test Macro Requirements for glibc (see
55 .\"O .BR feature_test_macros (7)):
57 .RB ( feature_test_macros (7)
62 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_C_SOURCE
68 .\"O are useful for dealing with errors
69 .\"O and interrupts encountered in a low-level subroutine of a program.
71 .\"O restores the environment saved by the last call of
73 .\"O with the corresponding \fIenv\fP argument.
76 .\"O is completed, program execution continues as if the
77 .\"O corresponding call of
79 .\"O had just returned the value
82 .\"O cannot cause 0 to be returned.
85 .\"O is invoked with a second argument of 0, 1 will be returned instead.
89 は、プログラムの低レベルなサブルーチンにおいて、
90 エラーや割り込みが発生した時の処理に便利である。
92 は、\fIenv\fP 引き数を指定して呼び出された最後の
96 の完了後、プログラムの実行は、まるで対応する
98 の呼び出しが値 \fIval\fP で返って来たかように続行される。
100 は 0 を返すように指示することはできない。
103 が呼ばれた場合は、代わりに 1 が返されることになる。
105 .\"O .BR siglongjmp ()
108 .\"O except for the type of
109 .\"O its \fIenv\fP argument.
110 .\"O If, and only if, the
111 .\"O .BR sigsetjmp (3)
112 .\"O call that set this
113 .\"O \fIenv\fP used a nonzero \fIsavesigs\fP flag,
114 .\"O .BR siglongjmp ()
115 .\"O also restores the signal mask that was saved by
116 .\"O .BR sigsetjmp (3).
118 は、引き数 \fIenv\fP の型が異なる点以外は、
123 が 0 以外の \fIsavesigs\fP フラグで呼び出されていた場合で、
128 より保存されていたシグナルマスクの復元を行う。
129 .\"O .SH "RETURN VALUE"
131 .\"O These functions never return.
133 .\"O .SH "CONFORMING TO"
135 .\"O C89, C99, and POSIX.1-2001 specify
137 .\"O POSIX.1-2001 specifies
138 .\"O .BR siglongjmp ().
140 は C89, C99, POSIX.1-2001 で規定されている。
142 は POSIX.1-2001 で規定されている。
145 .\"O POSIX does not specify whether
147 .\"O will restore the signal context (see
149 .\"O for some more details).
150 .\"O If you want to portably save and restore signal masks, use
151 .\"O .BR sigsetjmp ()
153 .\"O .BR siglongjmp ().
156 がシグナルコンテキスト (signal context) を復元するかどうか規定されていない
159 移植性のある方法で、シグナルマスクを保存し復元させたい場合には、
165 .\"O The values of automatic variables are unspecified after a call to
167 .\"O if they meet all the following criteria:
170 の呼び出しが行われた後の自動変数の値は未定義 (unspecified) となる。
172 .\"O they are local to the function that made the corresponding
177 呼び出しを行った関数のローカル変数である。
179 .\"O their values are changed between the calls to
190 .\"O they are not declared as
195 .\"O Analogous remarks apply for
196 .\"O .BR siglongjmp ().
203 .\"O .BR siglongjmp ()
204 .\"O make programs hard to
205 .\"O understand and maintain.
206 .\"O If possible an alternative should be used.
210 を使うと、プログラムは理解しづらく、保守しにくいものになる。
211 別の方法が可能なら、それを使うべきである。