File: getcontext.2

package info (click to toggle)
manpages-ja 0.5.0.0.20080615-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 20,508 kB
  • ctags: 1
  • sloc: sh: 13,690; perl: 157; makefile: 114
file content (170 lines) | stat: -rw-r--r-- 5,143 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
.\" Copyright (C) 2001 Andries Brouwer (aeb@cwi.nl)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved.
.\" Translated Sat Dec 15 2001 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\"
.TH GETCONTEXT 2 2001-11-15 "Linux" "Linux Programmer's Manual"
.SH ̾
getcontext, setcontext \- 桼ƥȤ/ꤹ
.SH 
.B #include <ucontext.h>
.sp
.BI "int getcontext(ucontext_t *" ucp );
.br
.BI "int setcontext(const ucontext_t *" ucp );
.SH 
System V ŪʴĶǤϡ
\fImcontext_t\fP  \fIucontext_t\fP Ȥ 2 Ĥηȡ
.BR getcontext (),
.BR setcontext (),
.BR makecontext (3),
.BR swapcontext (3)
Ȥ 4 Ĥδؿ
.I <ucontext.h>
Ƥꡢץ沼ˤʣΥåɴ֤ǡ
桼٥ΥƥؤǤ褦ˤʤäƤ롣
.LP
\fImcontext_t\fP ϥޥ¸ǡϱäƤ롣
\fIucontext_t\fP Ϲ¤ΤǡʤȤʲ 4 ĤΥեɤġ
.in +4
.nf

typedef struct ucontext {
    struct ucontext *uc_link;
    sigset_t         uc_sigmask;
    stack_t          uc_stack;
    mcontext_t       uc_mcontext;
    ...
} ucontext_t;

.fi
.in
\fIsigset_t\fP  \fIstack_t\fP 
.I <signal.h>
Ƥ롣
 \fIuc_link\fP ϡ
ߤΥƥȤλȤ
³ڤؤ륳ƥȤؤΥݥ󥿤Ǥ
(ߤΥƥȤ
.BR makecontext (3)
줿Τξ)
\fIuc_sigmask\fP ϤΥƥȤǥ֥åƤ
ʥ뷲Ǥ
.RB ( sigprocmask (2)
򸫤)
\fIuc_stack\fP ϤΥƥȤѤƤ륹åǤ
.RB ( signalstack (2)
򸫤)
\fIuc_mcontext\fP ¸Ƥ륳ƥȤ
ޥͭɽǤꡢ
ˤϸƤӽФåɤΥޥ쥸Ǽ롣
.LP
.BR getcontext ()
ؿϡ
ݥ \fIucp\fP ؤ¤Τ
ߥƥ֤ʥƥȤ˽롣
.LP
.BR setcontext ()
ؿϡݥ
\fIucp\fP ؤ桼ƥȤꥹȥ롣
ƤӽФ֤ʤ
ΥƥȤϡ
.BR getcontext ()
ޤ
.BR makecontext (3)
줿Τ
뤤ϥʥ軰ȤͿ줿Τˤʤ롣
.LP
ƥȤ
.BR getcontext ()
θƤӽФˤäƤΤξϡ
ץϤθƤӽФ֤äľ夫Τ褦˼¹Ԥ³롣
.LP
ƥȤ
.BR makecontext (3)
θƤӽФˤäƤΤξϡ
ץμ¹ԤϤ
.BR makecontext (3)
ƤӽФǻꤵ줿ؿ \fIfunc\fP
ƤӽФǷ³롣
\fIfunc\fP ֤ȡ
.BR makecontext (3)
ƤӽФǻꤵƤ
\fIucp\fP ¤Τ \fIuc_link\fP ФǷ³롣
ΥФ NULL äϡΥåɤϽλ롣
.LP
ƥȤʥϥɥθƤӽФˤäƤΤξϡ
Ťɸˤ
֥ץμ¹ԤϥʥˤäƳޤ줿̿μ̿ᤫ³ס
ʸ SUSv2 Ǻ줿Τǡ
ߤȽǤϡַ̤ƤʤפǤ롣
.SH ֤
ȡ
.BR getcontext ()
 0 ֤
.BR setcontext ()
֤ʤ
ԤȡξԤȤ \-1 ֤\fIerrno\fP 򥨥顼˱ꤹ롣
.SH 顼
Ƥʤ
.SH 
SUSv2, POSIX.1-2001.
.SH 
Υᥫ˥κǸŤμϡ
.BR setjmp (3)/ longjmp (3)
Ǥä
ˤϥʥ륳ƥȤμ갷ƤʤäΤǡ
ʳǤ
.BR sigsetjmp (3)/ siglongjmp (3)
Υڥ줿
ߤεǤϤäȺ٤椬Ǥ롣

.BR getcontext ()
֤äȤ
줬ǽθƤӽФǤä
Ȥ
.BR setcontext ()
ƤӽФΤΤǤ뤫
̤ưפˡʤʤäƤޤä
桼ϡ֤׵ʬǺʤФʤʤ
쥸ѿ (쥸ϥꥹȥƤޤΤ) äƤʤ
.LP
ʥ뤬ȯȡ
ߤΥ桼ƥȤ¸졢
ʥϥɥѤΥƥȤͥˤä롣
ϥϥɥ
.BR longjmp (3)
Ȥ碌ʤ:
δؿΥƥȲǤưƤʤ

.BR siglongjmp (3)

.BR setcontext ()
Ȥȡ
.SH Ϣ
.BR sigaction (2),
.BR sigaltstack (2),
.BR sigprocmask (2),
.BR longjmp (3),
.BR makecontext (3),
.BR sigsetjmp (3)