{"id":5531,"date":"2022-12-20T18:45:23","date_gmt":"2022-12-20T21:45:23","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/sighold-man3p\/"},"modified":"2022-12-20T18:45:23","modified_gmt":"2022-12-20T21:45:23","slug":"sighold-man3p","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/sighold-man3p\/","title":{"rendered":"SIGHOLD (man3p)"},"content":{"rendered":"<h1 align=\"center\">SIGHOLD<\/h1>\n<p> <a href=\"#PROLOG\">PROLOG<\/a><br \/> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#RETURN VALUE\">RETURN VALUE<\/a><br \/> <a href=\"#ERRORS\">ERRORS<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#APPLICATION USAGE\">APPLICATION USAGE<\/a><br \/> <a href=\"#RATIONALE\">RATIONALE<\/a><br \/> <a href=\"#FUTURE DIRECTIONS\">FUTURE DIRECTIONS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COPYRIGHT\">COPYRIGHT<\/a> <\/p>\n<hr>\n<h2>PROLOG <a name=\"PROLOG\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This manual page is part of the POSIX Programmer\u2019s Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.<\/p>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">sighold, sigignore, sigpause, sigrelse, sigset \u2014 signal management<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">#include <signal.h><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int sighold(int <i>sig<\/i>); <br \/> int sigignore(int <i>sig<\/i>); <br \/> int sigpause(int <i>sig<\/i>); <br \/> int sigrelse(int <i>sig<\/i>); <br \/> void (*sigset(int <i>sig<\/i>, void (*<i>disp<\/i>)(int)))(int);<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Use of any of these functions is unspecified in a multi-threaded process.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>sighold<\/i>(), <i>sigignore<\/i>(), <i>sigpause<\/i>(), <i>sigrelse<\/i>(), and <i>sigset<\/i>() functions provide simplified signal management.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>sigset<\/i>() function shall modify signal dispositions. The <i>sig<\/i> argument specifies the signal, which may be any signal except SIGKILL and SIGSTOP. The <i>disp<\/i> argument specifies the signal\u2019s disposition, which may be SIG_DFL, SIG_IGN, or the address of a signal handler. If <i>sigset<\/i>() is used, and <i>disp<\/i> is the address of a signal handler, the system shall add <i>sig<\/i> 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 <i>sigset<\/i>() is used, and <i>disp<\/i> is equal to SIG_HOLD, <i>sig<\/i> shall be added to the signal mask of the calling process and <i>sig<\/i>\u2019s disposition shall remain unchanged. If <i>sigset<\/i>() is used, and <i>disp<\/i> is not equal to SIG_HOLD, <i>sig<\/i> shall be removed from the signal mask of the calling process.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>sighold<\/i>() function shall add <i>sig<\/i> to the signal mask of the calling process.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>sigrelse<\/i>() function shall remove <i>sig<\/i> from the signal mask of the calling process.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>sigignore<\/i>() function shall set the disposition of <i>sig<\/i> to SIG_IGN.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>sigpause<\/i>() function shall remove <i>sig<\/i> from the signal mask of the calling process and suspend the calling process until a signal is received. The <i>sigpause<\/i>() function shall restore the signal mask of the process to its original state before returning.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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 <i>wait<\/i>(), <i>waitid<\/i>(), and <i>waitpid<\/i>() shall fail and set <i>errno<\/i> to <b>[ECHILD]<\/b>.<\/p>\n<h2>RETURN VALUE <a name=\"RETURN VALUE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Upon successful completion, <i>sigset<\/i>() shall return SIG_HOLD if the signal had been blocked and the signal\u2019s previous disposition if it had not been blocked. Otherwise, SIG_ERR shall be returned and <i>errno<\/i> set to indicate the error.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>sigpause<\/i>() function shall suspend execution of the thread until a signal is received, whereupon it shall return \u22121 and set <i>errno<\/i> to <b>[EINTR]<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For all other functions, upon successful completion, 0 shall be returned. Otherwise, \u22121 shall be returned and <i>errno<\/i> set to indicate the error.<\/p>\n<h2>ERRORS <a name=\"ERRORS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">These functions shall fail if:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>EINVAL<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"69%\">\n<p>The <i>sig<\/i> argument is an illegal signal number.<\/p>\n<\/td>\n<td width=\"9%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>sigset<\/i>() and <i>sigignore<\/i>() functions shall fail if:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p style=\"margin-top: 1em\"><b>EINVAL<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">An attempt is made to catch a signal that cannot be caught, or to ignore a signal that cannot be ignored.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>The following sections are informative.<\/i><\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">None.<\/p>\n<h2>APPLICATION USAGE <a name=\"APPLICATION USAGE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>sigaction<\/i>() function provides a more comprehensive and reliable mechanism for controlling signals; new applications should use the <i>sigaction<\/i>() function instead of the obsolescent <i>sigset<\/i>() function.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>sighold<\/i>() function, in conjunction with <i>sigrelse<\/i>() or <i>sigpause<\/i>(), may be used to establish critical regions of code that require the delivery of a signal to be temporarily deferred. For broader portability, the <i>pthread_sigmask<\/i>() or <i>sigprocmask<\/i>() functions should be used instead of the obsolescent <i>sighold<\/i>() and <i>sigrelse<\/i>() functions.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For broader portability, the <i>sigsuspend<\/i>() function should be used instead of the obsolescent <i>sigpause<\/i>() function.<\/p>\n<h2>RATIONALE <a name=\"RATIONALE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">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 <i>sigprocmask<\/i>(), which is replaced by <i>pthread_sigmask<\/i>()). The <i>sigset<\/i>() function can be implemented as a simple wrapper for <i>sigaction<\/i>(). The <i>sighold<\/i>() function is equivalent to <i>sigprocmask<\/i>() or <i>pthread_sigmask<\/i>() with SIG_BLOCK set. The <i>sigignore<\/i>() function is equivalent to <i>sigaction<\/i>() with SIG_IGN set. The <i>sigpause<\/i>() function is equivalent to <i>sigsuspend<\/i>(). The <i>sigrelse<\/i>() function is equivalent to <i>sigprocmask<\/i>() or <i>pthread_sigmask<\/i>() with SIG_UNBLOCK set.<\/p>\n<h2>FUTURE DIRECTIONS <a name=\"FUTURE DIRECTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">These functions may be removed in a future version.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>Section 2.4<\/i>, <i>Signal Concepts<\/i>, <i>exec<\/i>, <i>pause<\/i>(), <i>pthread_sigmask<\/i>(), <i>sigaction<\/i>(), <i>signal<\/i>(), <i>sigsuspend<\/i>(), <i>wait<\/i>(), <i>waitid<\/i>()<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The Base Definitions volume of POSIX.1-2017, <b><signal.h><\/b><\/p>\n<h2>COPYRIGHT <a name=\"COPYRIGHT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology &#8212; 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 .<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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 .<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  sighold, sigignore, sigpause, sigrelse, sigset \u2014 signal management <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3779,1],"tags":[1594,2417],"class_list":["post-5531","post","type-post","status-publish","format-standard","hentry","category-3pm-perl-llamadas-de-bibliotecas","category-sin-categoria","tag-man3p","tag-sighold"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/5531","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=5531"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/5531\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=5531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=5531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=5531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}