File: kill.2.html

package info (click to toggle)
rtlinux 3.1pre3-3
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 4,896 kB
  • ctags: 4,228
  • sloc: ansic: 26,204; sh: 2,069; makefile: 1,414; perl: 855; tcl: 489; asm: 380; cpp: 42
file content (277 lines) | stat: -rw-r--r-- 4,197 bytes parent folder | download | duplicates (2)
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<HTML
><HEAD
><TITLE
>kill</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
"></HEAD
><BODY
CLASS="REFENTRY"
><H1
><A
NAME="AEN1"
>kill</A
></H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN6"
></A
><H2
>Name</H2
>kill&nbsp;--&nbsp;(OBSOLETE, REMOVED) send signal to a process</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN9"
></A
><H2
>Synopsis</H2
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SYNOPSIS"
>       #include &#60;sys/types.h&#62;
       #include &#60;signal.h&#62;

       int <TT
CLASS="FUNCTION"
>kill</TT
> pid_t <TT
CLASS="PARAMETER"
><I
>pid</I
></TT
>, int sig);</PRE
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN13"
></A
><H2
>DESCRIPTION</H2
><P
> OBSOLETE and REMOVED. USE
PTHREAD_KILL.  The <TT
CLASS="FUNCTION"
>kill</TT
> system can be used to
send any signal to any process group or process.  In RTLinux there is
a single process and a single process group for each processor.  The
process group and the process identifier for that processor is the cpu
number + 1 (so that we can handle the stupid 0 convention described
below).</P
><P
>If <TT
CLASS="PARAMETER"
><I
>pid</I
></TT
> is positive, then signal
<TT
CLASS="PARAMETER"
><I
>sig</I
></TT
> is sent to <TT
CLASS="PARAMETER"
><I
>pid</I
></TT
>.</P
><P
>If <TT
CLASS="PARAMETER"
><I
>pid</I
></TT
> equals 0, then
<TT
CLASS="PARAMETER"
><I
>sig</I
></TT
> is sent to every process in the process
group of the current process. This is equivalent to sending the signal
to the current process in RTLinux.</P
><P
>If <TT
CLASS="PARAMETER"
><I
>pid</I
></TT
> equals -1, then
<TT
CLASS="PARAMETER"
><I
>sig</I
></TT
> is sent to every process except for the
first one, from higher numbers in the process table to lower.</P
><P
>If <TT
CLASS="PARAMETER"
><I
>pid</I
></TT
> is less than -1, then
<TT
CLASS="PARAMETER"
><I
>sig</I
></TT
> is sent to every process in the process
group <TT
CLASS="PARAMETER"
><I
>-pid</I
></TT
>.</P
><P
>If <TT
CLASS="PARAMETER"
><I
>sig</I
></TT
> is 0, then no signal is sent, but error
checking is still performed.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN33"
></A
><H2
>RETURN VALUE</H2
><P
>On success, zero is returned. On error, -1 is returned, and errno is set
appropriately.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN36"
></A
><H2
>ERRORS</H2
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>EINVAL</DT
><DD
><P
>An invalid signal was specified.</P
></DD
><DT
>ESRCH</DT
><DD
><P
>The <TT
CLASS="PARAMETER"
><I
>pid</I
></TT
> or
process group does not exit.  Note that an existing process might be a
zombie -- a process which already committed termination, but has not
yet been <TT
CLASS="FUNCTION"
>wait()</TT
>ed for.</P
></DD
><DT
>EPERM</DT
><DD
><P
>The process does not have
permission to send the signal to any of the receiving processes.  For
a process to have permission to send a signal to process
<TT
CLASS="PARAMETER"
><I
>pid</I
></TT
>, it must either have root privileges, or
the real or effective user ID of the sending process must equal the
real or saved set-user-ID of the receiving process.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN54"
></A
><H2
>BUGS</H2
><P
>It is impossible to send a signal to task number one, the init
process, for which it has not installed a signal handler.  This is
done to assure the system is not brought down accidentally.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN57"
></A
><H2
>NOTES</H2
><P
>In RTLinux, process number one is not special--it is just the process
on processor 0.  In a single processor system this is the only process
identifier.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN60"
></A
><H2
>CONFORMING TO</H2
><P
>SVr4, SVID, POSIX.1, X/OPEN, BSD 4.3</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN63"
></A
><H2
>SEE ALSO</H2
><A
HREF="../susv2/xsh/exit.html"
TARGET="_top"
>UNIX spec exit(2)</A
>, <A
HREF="../susv2/xsh/exit.html"
TARGET="_top"
>UNIX spec exit(3)</A
>, <A
HREF="../susv2/xsh/signal.html"
TARGET="_top"
>UNIX spec signal(2)</A
>, <A
HREF="../susv2/xsh/signal.html"
TARGET="_top"
>UNIX spec signal(7)</A
><P
>2001 FSMLabs Inc.</P
><P
>All rights reserved.</P
></DIV
></BODY
></HTML
>