GME  13
apr_signal.h
Go to the documentation of this file.
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef APR_SIGNAL_H
00018 #define APR_SIGNAL_H
00019 
00025 #include "apr.h"
00026 #include "apr_pools.h"
00027 
00028 #if APR_HAVE_SIGNAL_H
00029 #include <signal.h>
00030 #endif
00031 
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif /* __cplusplus */
00035 
00042 #if APR_HAVE_SIGACTION || defined(DOXYGEN)
00043 
00044 #if defined(DARWIN) && !defined(__cplusplus) && !defined(_ANSI_SOURCE)
00045 /* work around Darwin header file bugs
00046  *   http://www.opensource.apple.com/bugs/X/BSD%20Kernel/2657228.html
00047  */
00048 #undef SIG_DFL
00049 #undef SIG_IGN
00050 #undef SIG_ERR
00051 #define SIG_DFL (void (*)(int))0
00052 #define SIG_IGN (void (*)(int))1
00053 #define SIG_ERR (void (*)(int))-1
00054 #endif
00055 
00057 typedef void apr_sigfunc_t(int);
00058 
00064 APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func);
00065 
00066 #if defined(SIG_IGN) && !defined(SIG_ERR)
00067 #define SIG_ERR ((apr_sigfunc_t *) -1)
00068 #endif
00069 
00070 #else /* !APR_HAVE_SIGACTION */
00071 #define apr_signal(a, b) signal(a, b)
00072 #endif
00073 
00074 
00080 APR_DECLARE(const char *) apr_signal_description_get(int signum);
00081 
00087 void apr_signal_init(apr_pool_t *pglobal);
00088 
00094 APR_DECLARE(apr_status_t) apr_signal_block(int signum);
00095 
00101 APR_DECLARE(apr_status_t) apr_signal_unblock(int signum);
00102 
00105 #ifdef __cplusplus
00106 }
00107 #endif /* __cplusplus */
00108 
00109 #endif /* APR_SIGNAL_H */