SIGHOLD(3)                 POSIX Programmer's Manual                SIGHOLD(3)



PPRROOLLOOGG
       This manual page is part of the POSIX Programmer's Manual.  The OS
       implementation of this interface may differ (consult the corresponding
       OS manual page for details of OS behavior), or the interface may not be
       implemented on OS.

NNAAMMEE
       sighold, sigignore, sigpause, sigrelse, sigset -- signal management

SSYYNNOOPPSSIISS
       #include <signal.h>

       int sighold(int _s_i_g);
       int sigignore(int _s_i_g);
       int sigpause(int _s_i_g);
       int sigrelse(int _s_i_g);
       void (*sigset(int _s_i_g, void (*_d_i_s_p)(int)))(int);

DDEESSCCRRIIPPTTIIOONN
       Use of any of these functions is unspecified in a multi-threaded
       process.

       The _s_i_g_h_o_l_d(), _s_i_g_i_g_n_o_r_e(), _s_i_g_p_a_u_s_e(), _s_i_g_r_e_l_s_e(), and _s_i_g_s_e_t()
       functions provide simplified signal management.

       The _s_i_g_s_e_t() function shall modify signal dispositions. The _s_i_g
       argument specifies the signal, which may be any signal except SIGKILL
       and SIGSTOP. The _d_i_s_p argument specifies the signal's disposition,
       which may be SIG_DFL, SIG_IGN, or the address of a signal handler. If
       _s_i_g_s_e_t() is used, and _d_i_s_p is the address of a signal handler, the
       system shall add _s_i_g to the signal mask of the calling process before
       executing the signal handler; when the signal handler returns, the
       system shall restore the signal mask of the calling process to its
       state prior to the delivery of the signal. In addition, if _s_i_g_s_e_t() is
       used, and _d_i_s_p is equal to SIG_HOLD, _s_i_g shall be added to the signal
       mask of the calling process and _s_i_g's disposition shall remain
       unchanged. If _s_i_g_s_e_t() is used, and _d_i_s_p is not equal to SIG_HOLD, _s_i_g
       shall be removed from the signal mask of the calling process.

       The _s_i_g_h_o_l_d() function shall add _s_i_g to the signal mask of the calling
       process.

       The _s_i_g_r_e_l_s_e() function shall remove _s_i_g from the signal mask of the
       calling process.

       The _s_i_g_i_g_n_o_r_e() function shall set the disposition of _s_i_g to SIG_IGN.

       The _s_i_g_p_a_u_s_e() function shall remove _s_i_g from the signal mask of the
       calling process and suspend the calling process until a signal is
       received. The _s_i_g_p_a_u_s_e() function shall restore the signal mask of the
       process to its original state before returning.

       If the action for the SIGCHLD signal is set to SIG_IGN, child processes
       of the calling processes shall not be transformed into zombie processes
       when they terminate. If the calling process subsequently waits for its
       children, and the process has no unwaited-for children that were
       transformed into zombie processes, it shall block until all of its
       children terminate, and _w_a_i_t(), _w_a_i_t_i_d(), and _w_a_i_t_p_i_d() shall fail and
       set _e_r_r_n_o to [[EECCHHIILLDD]].

RREETTUURRNN VVAALLUUEE
       Upon successful completion, _s_i_g_s_e_t() shall return SIG_HOLD if the
       signal had been blocked and the signal's previous disposition if it had
       not been blocked. Otherwise, SIG_ERR shall be returned and _e_r_r_n_o set to
       indicate the error.

       The _s_i_g_p_a_u_s_e() function shall suspend execution of the thread until a
       signal is received, whereupon it shall return -1 and set _e_r_r_n_o to
       [[EEIINNTTRR]].

       For all other functions, upon successful completion, 0 shall be
       returned.  Otherwise, -1 shall be returned and _e_r_r_n_o set to indicate
       the error.

EERRRROORRSS
       These functions shall fail if:

       EEIINNVVAALL The _s_i_g argument is an illegal signal number.

       The _s_i_g_s_e_t() and _s_i_g_i_g_n_o_r_e() functions shall fail if:

       EEIINNVVAALL An attempt is made to catch a signal that cannot be caught, or
              to ignore a signal that cannot be ignored.

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

EEXXAAMMPPLLEESS
       None.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       The _s_i_g_a_c_t_i_o_n() function provides a more comprehensive and reliable
       mechanism for controlling signals; new applications should use the
       _s_i_g_a_c_t_i_o_n() function instead of the obsolescent _s_i_g_s_e_t() function.

       The _s_i_g_h_o_l_d() function, in conjunction with _s_i_g_r_e_l_s_e() or _s_i_g_p_a_u_s_e(),
       may be used to establish critical regions of code that require the
       delivery of a signal to be temporarily deferred. For broader
       portability, the _p_t_h_r_e_a_d___s_i_g_m_a_s_k() or _s_i_g_p_r_o_c_m_a_s_k() functions should be
       used instead of the obsolescent _s_i_g_h_o_l_d() and _s_i_g_r_e_l_s_e() functions.

       For broader portability, the _s_i_g_s_u_s_p_e_n_d() function should be used
       instead of the obsolescent _s_i_g_p_a_u_s_e() function.

RRAATTIIOONNAALLEE
       Each of these historic functions has a direct analog in the other
       functions which are required to be per-thread and thread-safe (aside
       from _s_i_g_p_r_o_c_m_a_s_k(), which is replaced by _p_t_h_r_e_a_d___s_i_g_m_a_s_k()).  The
       _s_i_g_s_e_t() function can be implemented as a simple wrapper for
       _s_i_g_a_c_t_i_o_n().  The _s_i_g_h_o_l_d() function is equivalent to _s_i_g_p_r_o_c_m_a_s_k() or
       _p_t_h_r_e_a_d___s_i_g_m_a_s_k() with SIG_BLOCK set. The _s_i_g_i_g_n_o_r_e() function is
       equivalent to _s_i_g_a_c_t_i_o_n() with SIG_IGN set. The _s_i_g_p_a_u_s_e() function is
       equivalent to _s_i_g_s_u_s_p_e_n_d().  The _s_i_g_r_e_l_s_e() function is equivalent to
       _s_i_g_p_r_o_c_m_a_s_k() or _p_t_h_r_e_a_d___s_i_g_m_a_s_k() with SIG_UNBLOCK set.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       These functions may be removed in a future version.

SSEEEE AALLSSOO
       _S_e_c_t_i_o_n _2_._4, _S_i_g_n_a_l _C_o_n_c_e_p_t_s, _e_x_e_c, _p_a_u_s_e(), _p_t_h_r_e_a_d___s_i_g_m_a_s_k(),
       _s_i_g_a_c_t_i_o_n(), _s_i_g_n_a_l(), _s_i_g_s_u_s_p_e_n_d(), _w_a_i_t(), _w_a_i_t_i_d()

       The Base Definitions volume of POSIX.1-2017, <<ssiiggnnaall..hh>>

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1-2017, Standard for Information Technology --
       Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the
       Institute of Electrical and Electronics Engineers, Inc and The Open
       Group.  In the event of any discrepancy between this version and the
       original IEEE and The Open Group Standard, the original IEEE and The
       Open Group Standard is the referee document. The original Standard can
       be obtained online at http://www.opengroup.org/unix/online.html .

       Any typographical or formatting errors that appear in this page are
       most likely to have been introduced during the conversion of the source
       files to man page format. To report such errors, see
       https://www.kernel.org/doc/man-pages/reporting_bugs.html .



IEEE/The Open Group                  2017                           SIGHOLD(3)
