source: rtems/doc/new_chapters/signal.t @ 4ebb486

4.104.114.84.95
Last change on this file since 4ebb486 was 4ebb486, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 1, 1998 at 3:49:38 PM

Removed all node and menu information since this information is now
automatically generated.

Removed any attempts to link across chapter boundaries since the manual
is incomplete.

  • Property mode set to 100644
File size: 8.9 KB
Line 
1@c
2@c  COPYRIGHT (c) 1988-1998.
3@c  On-Line Applications Research Corporation (OAR).
4@c  All rights reserved.
5@c
6@c  $Id$
7@c
8
9@chapter Signal Manager
10
11@section Introduction
12
13The signal manager ...
14
15The directives provided by the signal manager are:
16
17@itemize @bullet
18@item @code{sigaddset} -
19@item @code{sigdelset} -
20@item @code{sigfillset} -
21@item @code{sigismember} -
22@item @code{sigemptyset} -
23@item @code{sigaction} -
24@item @code{pthread_kill} -
25@item @code{sigprocmask} -
26@item @code{pthread_sigmask} -
27@item @code{kill} -
28@item @code{sigpending} -
29@item @code{sigsuspend} -
30@item @code{pause} -
31@item @code{sigwait} -
32@item @code{sigwaitinfo} -
33@item @code{sigtimedwait} -
34@item @code{sigqueue} -
35@item @code{alarm} -
36@end itemize
37
38@section Background
39
40@subsection Signal Delivery
41
42Signals directed at a thread are delivered to the specified thread.
43
44Signals directed at a process are delivered to a thread which is selected
45based on the following algorithm:
46
47@enumerate
48@item If the action for this signal is currently SIG_IGN, then the signal
49is simply ignored.
50
51@item If the currently executing thread has the signal unblocked, then
52the signal is delivered to it.
53
54@item If any threads are currently blocked waiting for this signal
55(sigwait()), then the signal is delivered to the highest priority
56thread waiting for this signal.
57
58@item If any other threads are willing to accept delivery of the signal, then
59the signal is delivered to the highest priority thread of this set.  In the
60event, multiple threads of the same priority are willing to accept this
61signal, then priority is given first to ready threads, then to threads
62blocked on calls which may be interrupted, and finally to threads blocked
63on non-interruptible calls.
64
65@item In the event the signal still can not be delivered, then it is left
66pending.  The first thread to unblock the signal (sigprocmask() or
67pthread_sigprocmask()) or to wait for this signal (sigwait()) will be
68the recipient of the signal.
69
70@end enumerate
71
72@section Operations
73
74@section Directives
75
76This section details the signal manager's directives.
77A subsection is dedicated to each of this manager's directives
78and describes the calling sequence, related constants, usage,
79and status codes.
80
81@page
82@subsection sigaddset
83
84@subheading CALLING SEQUENCE:
85
86@example
87#include <signal.h>
88
89int sigaddset(
90  sigset_t   *set,
91  int         signo
92);
93@end example
94
95@subheading STATUS CODES:
96
97@table @b
98@item EINVAL
99Invalid argument passed.
100
101@end table
102
103@subheading DESCRIPTION:
104
105@subheading NOTES:
106
107@page
108@subsection sigdelset
109
110@subheading CALLING SEQUENCE:
111
112@example
113#include <signal.h>
114
115int sigdelset(
116  sigset_t   *set,
117  int         signo
118);
119@end example
120
121@subheading STATUS CODES:
122
123@table @b
124@item EINVAL
125Invalid argument passed.
126
127@end table
128
129@subheading DESCRIPTION:
130
131@subheading NOTES:
132
133@page
134@subsection sigfillset
135
136@subheading CALLING SEQUENCE:
137
138@example
139#include <signal.h>
140
141int sigfillset(
142  sigset_t   *set
143);
144@end example
145
146@subheading STATUS CODES:
147@table @b
148@item EINVAL
149Invalid argument passed.
150
151@end table
152
153@subheading DESCRIPTION:
154
155@subheading NOTES:
156
157@page
158@subsection sigismember
159
160@subheading CALLING SEQUENCE:
161
162@example
163#include <signal.h>
164
165int sigismember(
166  const sigset_t   *set,
167  int               signo
168);
169@end example
170
171@subheading STATUS CODES:
172@table @b
173@item EINVAL
174Invalid argument passed.
175
176@end table
177
178@subheading DESCRIPTION:
179
180@subheading NOTES:
181
182@page
183@subsection sigemptyset
184
185@subheading CALLING SEQUENCE:
186
187@example
188#include <signal.h>
189
190int sigemptyset(
191  sigset_t   *set
192);
193@end example
194
195@subheading STATUS CODES:
196
197@table @b
198@item EINVAL
199Invalid argument passed.
200
201@end table
202
203@subheading DESCRIPTION:
204
205@subheading NOTES:
206
207@page
208@subsection sigaction
209
210@subheading CALLING SEQUENCE:
211
212@example
213#include <signal.h>
214
215int sigaction(
216  int                     sig,
217  const struct sigaction *act,
218  struct sigaction       *oact
219);
220@end example
221
222@subheading STATUS CODES:
223
224@table @b
225@item EINVAL
226Invalid argument passed.
227
228@item ENOTSUP
229Realtime Signals Extension option not supported.
230
231@end table
232
233@subheading DESCRIPTION:
234
235@subheading NOTES:
236
237The signal number cannot be SIGKILL.
238@page
239@subsection pthread_kill
240
241@subheading CALLING SEQUENCE:
242
243@example
244#include <signal.h>
245
246int pthread_kill(
247  pthread_t   thread,
248  int         sig
249);
250@end example
251
252@subheading STATUS CODES:
253@table @b
254@item ESRCH
255The thread indicated by the parameter thread is invalid.
256
257@item EINVAL
258Invalid argument passed.
259
260@end table
261
262@subheading DESCRIPTION:
263
264@subheading NOTES:
265
266@page
267@subsection sigprocmask
268 
269@subheading CALLING SEQUENCE:
270 
271@example
272#include <signal.h>
273 
274int sigprocmask(
275  int               how,
276  const sigset_t   *set,
277  sigset_t         *oset
278);
279@end example
280 
281@subheading STATUS CODES:
282@table @b
283@item EINVAL
284Invalid argument passed.
285 
286@end table
287 
288@subheading DESCRIPTION:
289 
290@subheading NOTES:
291 
292
293@page
294@subsection pthread_sigmask
295
296@subheading CALLING SEQUENCE:
297
298@example
299#include <signal.h>
300
301int pthread_sigmask(
302  int               how,
303  const sigset_t   *set,
304  sigset_t         *oset
305);
306@end example
307
308@subheading STATUS CODES:
309@table @b
310@item EINVAL
311Invalid argument passed.
312
313@end table
314
315@subheading DESCRIPTION:
316
317@subheading NOTES:
318
319
320@page
321@subsection kill
322
323@subheading CALLING SEQUENCE:
324
325@example
326#include <sys/types.h>
327#include <signal.h>
328
329int kill(
330  pid_t pid,
331  int   sig
332);
333@end example
334
335@subheading STATUS CODES:
336@table @b
337@item EINVAL
338Invalid argument passed.
339
340@item EPERM
341Process does not have permission to send the signal to any receiving process.
342
343@item ESRCH
344The process indicated by the parameter pid is invalid.
345
346@end table
347
348@subheading DESCRIPTION:
349
350@subheading NOTES:
351
352 
353@page
354@subsection sigpending
355 
356@subheading CALLING SEQUENCE:
357 
358@example
359#include <signal.h>
360 
361int sigpending(
362  const sigset_t  *set
363);
364@end example
365 
366@subheading STATUS CODES:
367
368On error, this routine returns -1 and sets errno to one of the following:
369 
370@table @b
371@item EFAULT
372Invalid address for set.
373
374@end table
375
376@subheading DESCRIPTION:
377 
378@subheading NOTES:
379
380@page
381@subsection sigsuspend
382 
383@subheading CALLING SEQUENCE:
384 
385@example
386#include <signal.h>
387 
388int sigsuspend(
389  const sigset_t  *sigmask
390);
391@end example
392 
393@subheading STATUS CODES:
394@table @b
395Returns -1 and sets errno.
396
397@item EINTR
398Signal interrupted this function.
399 
400@end table
401 
402@subheading DESCRIPTION:
403 
404@subheading NOTES:
405
406@page
407@subsection pause
408 
409@subheading CALLING SEQUENCE:
410 
411@example
412#include <signal.h>
413 
414int pause( void );
415@end example
416 
417@subheading STATUS CODES:
418@table @b
419Returns -1 and sets errno.
420 
421@item EINTR
422Signal interrupted this function.
423 
424@end table
425 
426@subheading DESCRIPTION:
427 
428@subheading NOTES:
429 
430@page
431@subsection sigwait
432
433@subheading CALLING SEQUENCE:
434
435@example
436#include <signal.h>
437
438int sigwait(
439  const sigset_t  *set,
440  int             *sig
441);
442@end example
443
444@subheading STATUS CODES:
445@table @b
446@item EINVAL
447Invalid argument passed.
448
449@item EINTR
450Signal interrupted this function.
451
452@end table
453
454@subheading DESCRIPTION:
455
456@subheading NOTES:
457
458@page
459@subsection sigwaitinfo
460 
461@subheading CALLING SEQUENCE:
462 
463@example
464#include <signal.h>
465 
466int sigwaitinfo(
467  const sigset_t  *set,
468  siginfo_t       *info
469);
470@end example
471 
472@subheading STATUS CODES:
473@table @b
474@item EINTR
475Signal interrupted this function.
476 
477@end table
478 
479@subheading DESCRIPTION:
480 
481@subheading NOTES:
482
483@page
484@subsection sigtimedwait
485 
486@subheading CALLING SEQUENCE:
487 
488@example
489#include <signal.h>
490 
491int sigtimedwait(
492  const sigset_t         *set,
493  siginfo_t              *info,
494  const struct timespec  *timeout
495);
496@end example
497 
498@subheading STATUS CODES:
499@table @b
500@item EAGAIN
501Timed out while waiting for the specified signal set.
502 
503@item EINVAL
504Nanoseconds field of the timeout argument is invalid.
505 
506@item EINTR
507Signal interrupted this function.
508 
509@end table
510 
511@subheading DESCRIPTION:
512 
513@subheading NOTES:
514
515If timeout is NULL, then the thread will wait forever for the specified
516signal set.
517
518@page
519@subsection sigqueue
520 
521@subheading CALLING SEQUENCE:
522 
523@example
524#include <signal.h>
525 
526int sigqueue(
527  pid_t               pid,
528  int                 signo,
529  const union sigval  value
530);
531@end example
532 
533@subheading STATUS CODES:
534
535@table @b
536
537@item EAGAIN
538No resources available to queue the signal.  The process has already
539queued SIGQUEUE_MAX signals that are still pending at the receiver
540or the systemwide resource limit has been exceeded.
541 
542@item EINVAL
543The value of the signo argument is an invalid or unsupported signal
544number.
545 
546@item EPERM
547The process does not have the appropriate privilege to send the signal
548to the receiving process.
549
550@item ESRCH
551The process pid does not exist.
552 
553@end table
554 
555@subheading DESCRIPTION:
556 
557@subheading NOTES:
558
559
560@page
561@subsection alarm
562 
563@subheading CALLING SEQUENCE:
564 
565@example
566#include <signal.h>
567 
568unsigned int alarm(
569  unsigned int  seconds
570);
571@end example
572 
573@subheading STATUS CODES:
574
575If there was a previous alarm() request with time remaining, then this routine
576returns the number of seconds until that outstanding alarm would have fired.
577If no previous alarm() request was outstanding, then zero is returned.
578 
579@subheading DESCRIPTION:
580 
581@subheading NOTES:
582
583
Note: See TracBrowser for help on using the repository browser.