source: rtems/doc/posix_users/signal.texi @ 1e524995

4.104.114.84.95
Last change on this file since 1e524995 was 1e524995, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 6, 1998 at 2:14:30 PM

Updated copyrights

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