home *** CD-ROM | disk | FTP | other *** search
-
-
-
- SSSSIIIIGGGGVVVVEEEECCCC((((3333BBBB)))) SSSSIIIIGGGGVVVVEEEECCCC((((3333BBBB))))
-
-
-
- NNNNAAAAMMMMEEEE
- sigvec - 4.3BSD software signal facilities
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ssssiiiiggggnnnnaaaallll....hhhh>>>>
-
- ssssttttrrrruuuucccctttt ssssiiiiggggvvvveeeecccc {{{{
- iiiinnnntttt ((((****ssssvvvv____hhhhaaaannnnddddlllleeeerrrr))))((((iiiinnnntttt,,,, iiiinnnntttt))));;;;
- iiiinnnntttt ssssvvvv____mmmmaaaasssskkkk;;;;
- iiiinnnntttt ssssvvvv____ffffllllaaaaggggssss;;;;
- }}}};;;;
-
- iiiinnnntttt ssssiiiiggggvvvveeeecccc((((iiiinnnntttt ssssiiiigggg,,,, ssssttttrrrruuuucccctttt ssssiiiiggggvvvveeeecccc ****vvvveeeecccc,,,, ssssttttrrrruuuucccctttt ssssiiiiggggvvvveeeecccc ****oooovvvveeeecccc))));;;;
-
- To use any of the BSD signal routines (_k_i_l_l(3B), _k_i_l_l_p_g(3B),
- _s_i_g_b_l_o_c_k(3B), _s_i_g_n_a_l(3B), _s_i_g_p_a_u_s_e(3B), _s_i_g_s_e_t_m_a_s_k(3B), _s_i_g_s_t_a_c_k(2B),
- _s_i_g_v_e_c(3B)) you must either
-
- 1) #define ____BBBBSSSSDDDD____SSSSIIIIGGGGNNNNAAAALLLLSSSS or ____BBBBSSSSDDDD____CCCCOOOOMMMMPPPPAAAATTTT before including <_s_i_g_n_a_l._h>, or
-
- 2) specify one of them in the compile command or makefile:
-
- cc -D_BSD_SIGNALS -o prog prog.c
-
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _s_i_g_v_e_c specifies and reports on the way individual signals are to be
- handled in the calling process. If _v_e_c is non-zero, it alters the way
- the signal will be treated - default behavior, ignored, or handled via a
- routine - and the signal mask to be used when delivering the signal if a
- handler is installed. If _o_v_e_c is non-zero, the previous handling
- information for the signal is returned to the user. In this way (a NULL
- _v_e_c and a non-NULL _o_v_e_c) the user can inquire as to the current handling
- of a signal without changing it. If both _v_e_c and _o_v_e_c are NULL, _s_i_g_v_e_c
- will return -1 and set _e_r_r_n_o to EEEEIIIINNNNVVVVAAAALLLL if _s_i_g is an invalid signal (else
- 0), allowing an application to dynamically determine the set of signals
- supported by the system.
-
- The system defines a set of signals that may be delivered to a process.
- Signal delivery resembles the occurrence of a hardware interrupt: the
- signal is blocked from further occurrence, the current process context is
- saved, and a new one is built. A process may specify a _h_a_n_d_l_e_r to which
- a signal is delivered, or specify that a signal is to be _b_l_o_c_k_e_d or
- _i_g_n_o_r_e_d. A process may also specify that a default action is to be taken
- by the system when a signal occurs.
-
- All signals have the same _p_r_i_o_r_i_t_y. Signal routines execute with the
- signal that caused their invocation _b_l_o_c_k_e_d, but other signals may yet
- occur. A global _s_i_g_n_a_l _m_a_s_k defines the set of signals currently blocked
- from delivery to a process. The signal mask for a process is initialized
- from that of its parent (normally 0). It may be changed with a
- _s_i_g_b_l_o_c_k(3B) or _s_i_g_s_e_t_m_a_s_k(3B) call, or when a signal is delivered to the
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- SSSSIIIIGGGGVVVVEEEECCCC((((3333BBBB)))) SSSSIIIIGGGGVVVVEEEECCCC((((3333BBBB))))
-
-
-
- process.
-
- When a signal condition arises for a process, the signal is added to a
- set of signals pending for the process. If the signal is not currently
- _b_l_o_c_k_e_d by the process then it is delivered to the process. When a
- signal is delivered, the current state of the process is saved, a new
- signal mask is calculated (as described below), and the signal handler is
- invoked. The call to the handler is arranged so that if the signal
- handling routine returns normally the process will resume execution in
- the context from before the signal's delivery. If the process wishes to
- resume in a different context, then it must arrange to restore the
- previous context itself.
-
- When a signal is delivered to a process a new signal mask is installed
- for the duration of the process' signal handler (or until a _s_i_g_b_l_o_c_k or
- _s_i_g_s_e_t_m_a_s_k call is made). This mask is formed by taking the current
- signal mask, adding the signal to be delivered, and _o_r'ing in the signal
- mask associated with the handler to be invoked.
-
- _S_i_g_v_e_c assigns a handler for a specific signal. If _v_e_c is non-zero, it
- specifies a handler routine and mask to be used when delivering the
- specified signal. Further, if the SV_ONSTACK bit is set in _s_v__f_l_a_g_s, the
- system will deliver the signal to the process on a _s_i_g_n_a_l _s_t_a_c_k,
- specified with _s_i_g_s_t_a_c_k(2b).
-
- For a list of valid signal numbers and a general description of the
- signal mechanism, please see _ssss_iiii_gggg_nnnn_aaaa_llll(5).
-
- Once a signal handler is installed, it remains installed until another
- _s_i_g_v_e_c call is made, or an _e_x_e_c_v_e(2) is performed. The default action
- for a signal may be reinstated by setting _s_v__h_a_n_d_l_e_r to SSSSIIIIGGGG____DDDDFFFFLLLL; this
- default is termination with a core image for signals marked [[[[1111]]]]. If
- _s_v__h_a_n_d_l_e_r is SSSSIIIIGGGG____IIIIGGGGNNNN the signal is subsequently ignored, and pending
- instances of the signal are discarded.
-
- SSSSIIIIGGGGKKKKIIIILLLLLLLL will immediately terminate a process, regardless of its state.
- Processes which are stopped via job control (typically <ctrl>-Z) will not
- act upon any delivered signals other than SSSSIIIIGGGGKKKKIIIILLLLLLLL until the job is
- restarted. Processes which are blocked via a _b_l_o_c_k_p_r_o_c(2) system call
- will unblock if they receive a signal which is fatal (i.e., a non-job-
- control signal which they are NOT catching), but will still be stopped if
- the job of which they are a part is stopped. Only upon restart will they
- die. Any non-fatal signals received by a blocked process will NOT cause
- the process to be unblocked (a call to _u_n_b_l_o_c_k_p_r_o_c(2) or
- _u_n_b_l_o_c_k_p_r_o_c_a_l_l(2) is necessary).
-
- After a _f_o_r_k(2) the child inherits all handlers, the signal stack and the
- signal masks, but not the set of the pending signals.
-
- The _e_x_e_c(2) routines reset all caught signals to default action , clear
- all handler masks and reset all signals to be caught on the user stack.
- Ignored signals remain ignored; the blocked signal mask is unchanged and
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- SSSSIIIIGGGGVVVVEEEECCCC((((3333BBBB)))) SSSSIIIIGGGGVVVVEEEECCCC((((3333BBBB))))
-
-
-
- pending signals remain pending.
-
- The mask specified in _v_e_c is not allowed to block SSSSIIIIGGGGKKKKIIIILLLLLLLL, SSSSIIIIGGGGSSSSTTTTOOOOPPPP, or
- SSSSIIIIGGGGCCCCOOOONNNNTTTT. This is enforced silently by the system.
-
- RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
- A 0 value indicated that the call succeeded. A -1 return value indicates
- an error occurred and _e_r_r_n_o is set to indicate the reason.
-
- EEEERRRRRRRROOOORRRRSSSS
- _s_i_g_v_e_c is a library routine (executing in user space): if either _v_e_c or
- _o_v_e_c points to memory that is not a valid part of the process address
- space, the process will receive a memory fault (SSSSIIIIGGGGSSSSEEEEGGGGVVVV) signal and
- terminate (unless it has installed a handler for SSSSIIIIGGGGSSSSEEEEGGGGVVVV). If the
- invalid pointer is the result of using a REFERENCE instead of a POINTER,
- the compiler will issue a warning.
-
- _s_i_g_v_e_c will fail and no new signal handler will be installed if one of
- the following occurs:
-
- [EINVAL] _S_i_g is not a valid signal number.
-
- [EINVAL] An attempt is made to ignore or supply a handler for
- SSSSIIIIGGGGKKKKIIIILLLLLLLL or SSSSIIIIGGGGSSSSTTTTOOOOPPPP.
-
- [EINVAL] An attempt is made to ignore SSSSIIIIGGGGCCCCOOOONNNNTTTT (by default SSSSIIIIGGGGCCCCOOOONNNNTTTT
- is ignored).
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- kill(3B), sigblock(3B), sigsetmask(3B), sigpause(3B), sigvec(3B),
- setjmp(3), blockproc(2), signal(5).
-
- CCCCAAAAVVVVEEEEAAAATTTTSSSS ((((IIIIRRRRIIIIXXXX))))
- 4.2BSD attempts to restart system calls which are interrupted by signal
- receipt; 4.3BSD gives the programmer a choice of restart or failed-
- return-with-error via the SSSSVVVV____IIIINNNNTTTTEEEERRRRRRRRUUUUPPPPTTTT flag in _s_i_g_v_e_c or use of the
- _s_i_g_i_n_t_e_r_r_u_p_t library routine. IRIX provides _o_n_l_y the fail-with-error
- option. The affected system calls are _r_e_a_d(2), _w_r_i_t_e(2), _o_p_e_n(2),
- _i_o_c_t_l(2), and _w_a_i_t(2). Refer to the _s_i_g_s_e_t(2) man page for more a
- detailed description of the behavior.
-
- WWWWAAAARRRRNNNNIIIINNNNGGGG ((((IIIIRRRRIIIIXXXX))))
- The 4.3BSD and System V signal facilities have different semantics.
- Using both facilities in the same program is ssssttttrrrroooonnnnggggllllyyyy ddddiiiissssccccoooouuuurrrraaaaggggeeeedddd and
- will result in unpredictable behavior.
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-