5ad5dffe06818a13e1632b1119fbca7881085fc1Dominik Luecke Unix SMB/CIFS implementation.
e9458b1a7a19a63aa4c179f9ab20f4d50681c168Jens Elkner signal handling functions
5ad5dffe06818a13e1632b1119fbca7881085fc1Dominik Luecke Copyright (C) Andrew Tridgell 1998
5ad5dffe06818a13e1632b1119fbca7881085fc1Dominik Luecke This program is free software; you can redistribute it and/or modify
2eeec5240b424984e3ee26296da1eeab6c6d739eChristian Maeder it under the terms of the GNU General Public License as published by
5ad5dffe06818a13e1632b1119fbca7881085fc1Dominik Luecke the Free Software Foundation; either version 3 of the License, or
5ad5dffe06818a13e1632b1119fbca7881085fc1Dominik Luecke (at your option) any later version.
5ad5dffe06818a13e1632b1119fbca7881085fc1Dominik Luecke This program is distributed in the hope that it will be useful,
5ad5dffe06818a13e1632b1119fbca7881085fc1Dominik Luecke but WITHOUT ANY WARRANTY; without even the implied warranty of
5ad5dffe06818a13e1632b1119fbca7881085fc1Dominik Luecke MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5ad5dffe06818a13e1632b1119fbca7881085fc1Dominik Luecke GNU General Public License for more details.
da955132262baab309a50fdffe228c9efe68251dCui Jian You should have received a copy of the GNU General Public License
5ad5dffe06818a13e1632b1119fbca7881085fc1Dominik Luecke along with this program. If not, see <http://www.gnu.org/licenses/>.
5ad5dffe06818a13e1632b1119fbca7881085fc1Dominik Luecke * @brief Signal handling
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder Block sigs.
548f3850942936a8c6021185c8391dfcd3b03018Dominik Luecke sigprocmask(block?SIG_BLOCK:SIG_UNBLOCK,&set,NULL);
fc5cd838fb20cabc8494e3fba1c76c434dc92f30Christian Maeder sigsetmask(siggetmask() & ~sigmask(signum));
5ad5dffe06818a13e1632b1119fbca7881085fc1Dominik Luecke /* yikes! This platform can't block signals? */
5ad5dffe06818a13e1632b1119fbca7881085fc1Dominik Luecke DEBUG(SSSDBG_FATAL_FAILURE,"WARNING: No signal blocking available\n");
b694e4b3f771a2f32042c9c505dd698bde969558Dominik Luecke Catch a signal. This should implement the following semantics:
202df46772cac2ee2e8627ba196a5faebb6f9a05Christian Maeder 1) The handler remains installed after being called.
202df46772cac2ee2e8627ba196a5faebb6f9a05Christian Maeder 2) The signal should be blocked during handler execution.
b694e4b3f771a2f32042c9c505dd698bde969558Dominik Lueckevoid (*CatchSignal(int signum,void (*handler)(int )))(int)
6e2dba19f0c5ef183c1ac9cf1dff55b9626aeabdDominik Luecke * We *want* SIGALRM to interrupt a system call.