1
/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
22
* @brief APR Signal Handling
26
#include "apr_pools.h"
34
#endif /* __cplusplus */
37
* @defgroup apr_signal Handling
42
#if APR_HAVE_SIGACTION || defined(DOXYGEN)
44
#if defined(DARWIN) && !defined(__cplusplus) && !defined(_ANSI_SOURCE)
45
/* work around Darwin header file bugs
46
* http://www.opensource.apple.com/bugs/X/BSD%20Kernel/2657228.html
51
#define SIG_DFL (void (*)(int))0
52
#define SIG_IGN (void (*)(int))1
53
#define SIG_ERR (void (*)(int))-1
56
/** Function prototype for signal handlers */
57
typedef void apr_sigfunc_t(int);
60
* Set the signal handler function for a given signal
61
* @param signo The signal (eg... SIGWINCH)
62
* @param func the function to get called
64
APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func);
66
#if defined(SIG_IGN) && !defined(SIG_ERR)
67
#define SIG_ERR ((apr_sigfunc_t *) -1)
70
#else /* !APR_HAVE_SIGACTION */
71
#define apr_signal(a, b) signal(a, b)
76
* Get the description for a specific signal number
77
* @param signum The signal number
78
* @return The description of the signal
80
APR_DECLARE(const char *) apr_signal_description_get(int signum);
83
* APR-private function for initializing the signal package
85
* @param pglobal The internal, global pool
87
void apr_signal_init(apr_pool_t *pglobal);
90
* Block the delivery of a particular signal
91
* @param signum The signal number
94
APR_DECLARE(apr_status_t) apr_signal_block(int signum);
97
* Enable the delivery of a particular signal
98
* @param signum The signal number
101
APR_DECLARE(apr_status_t) apr_signal_unblock(int signum);
107
#endif /* __cplusplus */
109
#endif /* APR_SIGNAL_H */