~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to srclib/apr/include/apr_signal.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
 
2
 * applicable.
 
3
 *
 
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
 
7
 *
 
8
 *     http://www.apache.org/licenses/LICENSE-2.0
 
9
 *
 
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.
 
15
 */
 
16
 
 
17
#ifndef APR_SIGNAL_H
 
18
#define APR_SIGNAL_H
 
19
 
 
20
/**
 
21
 * @file apr_signal.h 
 
22
 * @brief APR Signal Handling
 
23
 */
 
24
 
 
25
#include "apr.h"
 
26
#include "apr_pools.h"
 
27
 
 
28
#if APR_HAVE_SIGNAL_H
 
29
#include <signal.h>
 
30
#endif
 
31
 
 
32
#ifdef __cplusplus
 
33
extern "C" {
 
34
#endif /* __cplusplus */
 
35
 
 
36
/**
 
37
 * @defgroup apr_signal Handling
 
38
 * @ingroup APR 
 
39
 * @{
 
40
 */
 
41
 
 
42
#if APR_HAVE_SIGACTION || defined(DOXYGEN)
 
43
 
 
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
 
47
 */
 
48
#undef SIG_DFL
 
49
#undef SIG_IGN
 
50
#undef SIG_ERR
 
51
#define SIG_DFL (void (*)(int))0
 
52
#define SIG_IGN (void (*)(int))1
 
53
#define SIG_ERR (void (*)(int))-1
 
54
#endif
 
55
 
 
56
/** Function prototype for signal handlers */
 
57
typedef void apr_sigfunc_t(int);
 
58
 
 
59
/**
 
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
 
63
 */
 
64
APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func);
 
65
 
 
66
#if defined(SIG_IGN) && !defined(SIG_ERR)
 
67
#define SIG_ERR ((apr_sigfunc_t *) -1)
 
68
#endif
 
69
 
 
70
#else /* !APR_HAVE_SIGACTION */
 
71
#define apr_signal(a, b) signal(a, b)
 
72
#endif
 
73
 
 
74
 
 
75
/**
 
76
 * Get the description for a specific signal number
 
77
 * @param signum The signal number
 
78
 * @return The description of the signal
 
79
 */
 
80
APR_DECLARE(const char *) apr_signal_description_get(int signum);
 
81
 
 
82
/**
 
83
 * APR-private function for initializing the signal package
 
84
 * @internal
 
85
 * @param pglobal The internal, global pool
 
86
 */
 
87
void apr_signal_init(apr_pool_t *pglobal);
 
88
 
 
89
/**
 
90
 * Block the delivery of a particular signal
 
91
 * @param signum The signal number
 
92
 * @return status
 
93
 */
 
94
APR_DECLARE(apr_status_t) apr_signal_block(int signum);
 
95
 
 
96
/**
 
97
 * Enable the delivery of a particular signal
 
98
 * @param signum The signal number
 
99
 * @return status
 
100
 */
 
101
APR_DECLARE(apr_status_t) apr_signal_unblock(int signum);
 
102
 
 
103
/** @} */
 
104
 
 
105
#ifdef __cplusplus
 
106
}
 
107
#endif /* __cplusplus */
 
108
 
 
109
#endif /* APR_SIGNAL_H */