Vendor import apr-1.7.0
This commit is contained in:
parent
f7eb533f85
commit
a6c43c64d9
143
CHANGES
143
CHANGES
@ -1,132 +1,57 @@
|
||||
-*- coding: utf-8 -*-
|
||||
Changes for APR 1.6.5
|
||||
Changes for APR 1.7.0
|
||||
|
||||
*) Fix Win32 build breakage in apr_os_exp_time_put() in 1.6.4. [Rainer Jung]
|
||||
|
||||
Changes for APR 1.6.4 (not released)
|
||||
*) apr_dir_read: [Unix] Dropped the preference of the dirread_r() flavor
|
||||
for dirread(), because the former is both deprecated and unneeded.
|
||||
[Yann Ylavic, William Rowe]
|
||||
|
||||
*) configure: Fix detection of <net/if.h> on OpenBSD.
|
||||
PR 61976. [David Carlier <devnexen gmail.com>, Yann Ylavic]
|
||||
*) apr_file_info: [Win32 only] Treat only "name surrogate" reparse points
|
||||
as symlinks, and not other reparse tag types. PR47630
|
||||
[Oleg Liatte <olegliatte gmail.com>]
|
||||
|
||||
*) Fix apr_parse_addr_port() regression in scope_id parsing introduced
|
||||
in 1.6.3. [Rainer Jung]
|
||||
*) Test %ld vs. %lld to avoid compiler emits using APR_OFF_T_FMT, in the
|
||||
case of apparently equivilant long and long long types. [William Rowe]
|
||||
|
||||
*) Fix Win32 file buffer locking behavior for single threaded file streams.
|
||||
[Evgeny Kotkov, Mladen Turk, Jean-Frederic Clere]
|
||||
*) Recognize APPLE predefined macros as equivilant to DARWIN. [Jim Jagielski]
|
||||
|
||||
*) Numerous corrections to APR poll behavior. [Yann Ylavic]
|
||||
*) Signals: Allow handling of SIGUSR2 in apr_signal_thread. [Yann Ylavic]
|
||||
|
||||
Changes for APR 1.6.3
|
||||
*) Atomics: Support for 64bit ints. [Jim Jagielski]
|
||||
|
||||
*) apr_file_trunc: Truncating a buffered file could add unexpected
|
||||
data after the truncate position. PR 51017.
|
||||
[Evgeny Kotkov <evgeny.kotkov visualsvn.com>]
|
||||
*) Add the apr_encode_* API that implements RFC4648 and RFC7515
|
||||
compliant BASE64, BASE64URL, BASE32, BASE32HEX and BASE16
|
||||
encode/decode functions. [Graham Leggett]
|
||||
|
||||
*) apr_file_trunc: Fix an issue where reading from a buffered file
|
||||
after truncate could return stale data from the buffer.
|
||||
[Evgeny Kotkov <evgeny.kotkov visualsvn.com>]
|
||||
*) rand: Use arc4random_buf() on BSD platforms and getrandom() on Linux,
|
||||
when available. [Christian Weisgerber <naddy openbsd.org, Yann Ylavic]
|
||||
|
||||
*) apr_ipsubnet_create() now fails for an empty input string.
|
||||
[Joe Orton]
|
||||
*) Add apr_sockaddr_zone_set, apr_sockaddr_zone_set to set and retrieve
|
||||
the zone for link-local IPv6 addresses. [Joe Orton]
|
||||
|
||||
Changes for APR 1.6.2
|
||||
*) apr_sockaddr_equal: Compare link-local IPv6 addresses with different
|
||||
zones as not equal. [Joe Orton]
|
||||
|
||||
*) Corrected non-Unix builds for APR_LOCK_DEFAULT.
|
||||
*) apr_sockaddr_ip_getbuf, apr_sockaddr_ip_get: Append "%zone" for
|
||||
IPv6 link-local addresses. [Joe Orton]
|
||||
|
||||
Changes for APR 1.6.1
|
||||
*) Locks: add a --disable-timedlocks config option in case users
|
||||
encounter more platforms where it fails [Nick Kew].
|
||||
|
||||
*) Defer timed locks API for later 1.7 release [Nick Kew, William Rowe]
|
||||
*) apr_allocator, apr_pools: Add apr_allocator_page_size() and
|
||||
apr_allocator_min_order_set() to respectively get the (system's) page size
|
||||
in use and set the minimum allocation size for an allocator (expressed in
|
||||
2^order pages). [Yann Ylavic]
|
||||
|
||||
*) Export build files find_apr.m4 and apr_common.m4 [Jacob Champion]
|
||||
|
||||
Changes for APR 1.6.0
|
||||
|
||||
*) apr_allocator: Provide apr_allocator_align() to get the true size that
|
||||
would be allocated for the given size (including the header and
|
||||
alignment). [Yann Ylavic]
|
||||
|
||||
*) apr_os_proc_mutex_put_ex: Allow to specify whether the OS native
|
||||
mutex should or not be cleaned up (destroyed) with the constructed
|
||||
APR mutex (given pool), and default to not for the simple _put()
|
||||
function. [Yann Ylavic]
|
||||
|
||||
*) apr_proc/global_mutex: Fix API regarding the native OS mutexes
|
||||
accessors from/to available APR mechanisms, adding the new functions
|
||||
apr_os_proc_mutex_get_ex() and apr_os_proc_mutex_set_ex() which give
|
||||
control to the user over the selected mechanisms, including the missing
|
||||
POSIX semaphores (sem_t) on platforms supporting them.
|
||||
[Yann Ylavic]
|
||||
|
||||
*) apr_proc_mutex-pthread: Refcount shared mutexes usage to avoid
|
||||
destruction while still is use by some process(es). PR 49504.
|
||||
[Yann Ylavic]
|
||||
|
||||
*) apr_file_io: Add apr_file_pipe_create_pools() allowing a pair of
|
||||
pipes to be created, each in a different pool. [Graham Leggett]
|
||||
|
||||
*) Add apr_pollcb_wakeup(), with similar behavior to
|
||||
apr_pollset_wakeup(). Add apr_pollcb_method_name(), with similar
|
||||
behavior to apr_pollset_method_name().
|
||||
[Neil Conway <nrc cs berkeley edu>, Jeff Trawick]
|
||||
|
||||
*) apr_table_overlap: Add APR_OVERLAP_TABLES_ADD to merge and set when
|
||||
overlapping tables. [Graham Leggett]
|
||||
*) locks: provide portable implementations of timedlock()s for
|
||||
posix-sems, sysv-sems and pthreads for those platforms that
|
||||
lack native versions (eg: OSX/macOS). [Jim Jagielski]
|
||||
|
||||
*) locks: Introduce apr_{thread,proc,global}_mutex_timedlock().
|
||||
[Yann Ylavic]
|
||||
|
||||
*) Introduce the apr_cstr_fn() family of functions, derived from
|
||||
the svn_cstring_ functions of the Subversion project.
|
||||
Changes for APR 1.6.x and later:
|
||||
|
||||
*) Add APR_SO_FREEBIND option for apr_socket_opt_set. PR 58725.
|
||||
[Ashley GC, Jan Kaluza, Joe Orton]
|
||||
|
||||
*) apr_filepath_merge: Fix truename length calculation on Windows
|
||||
in cases where the "short" name variant is actually longer than
|
||||
the "long" or "true" name. See: testnames.c:merge_shortname().
|
||||
[Bert Huijben <rhuijben a.o>]
|
||||
|
||||
*) apr_atomic: Fix errors when building on Visual Studio 2013 while
|
||||
maintaining the ability to build on Visual Studio 6 with Windows
|
||||
Server 2003 R2 SDK. PR 57191. [Gregg Smith]
|
||||
|
||||
*) apr_skiplist: Add apr_skiplist_addne*() family to preserve existing
|
||||
values (no duplicate), add apr_skiplist_size(), apr_skiplist_height()
|
||||
and apr_skiplist_preheight() to get the corresponding current values,
|
||||
and apr_skiplist_set_preheight() to modify it. [ Yann Ylavic ]
|
||||
|
||||
*) Add new --enable-allocator-guard-pages which is like allocator-uses-mmap,
|
||||
but will also add inaccessible guard pages before and after each memnode.
|
||||
This will result in higher ressource usage but allow to find/protect
|
||||
against certain buffer overflow/overread bugs. Under Linux, it may be
|
||||
necessary to increase /proc/sys/vm/max_map_count . [Stefan Fritsch]
|
||||
|
||||
*) apr_skiplist: Add apr_skiplist_add() to support multiple values.
|
||||
|
||||
*) Add new --enable-pool-concurrency-check configure option to detect
|
||||
thread-unsafe concurrent accesses to pools. Runtime costs should be
|
||||
relatively low. [Stefan Fritsch]
|
||||
|
||||
*) Add support code to teach valgrind about APR pools and allocators.
|
||||
[Stefan Fritsch]
|
||||
|
||||
*) Add apr_sockaddr_info_copy(), for making a deep copy of an
|
||||
apr_sockaddr_t into a specified pool. [Yann Ylavic
|
||||
<ylavic.dev gmail.com>]
|
||||
|
||||
*) Added Unix domain socket support.
|
||||
[Mladen Turk]
|
||||
|
||||
*) Add apr_shm_delete() to compliment apr_shm_remove().
|
||||
[Jim Jagielski]
|
||||
|
||||
*) Intruduce APR_PERMS_SET macros for setting the owner/group on
|
||||
objects. Currently only implemented for shm, proc and global
|
||||
mutexes on posix platforms.
|
||||
[Mladen Turk]
|
||||
|
||||
*) Add apr_escape_ldap() and apr_pescape_ldap(), escaping characters
|
||||
as described by RFC4514 and RFC4515 respectively. [Graham Leggett]
|
||||
*) http://svn.apache.org/viewvc/apr/apr/branches/1.6.x/CHANGES?view=markup
|
||||
|
||||
Changes for APR 1.5.x and later:
|
||||
|
||||
|
@ -63,6 +63,7 @@ exec_prefix=@exec_prefix@
|
||||
bindir=@bindir@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
datarootdir=@datarootdir@
|
||||
datadir=@datadir@
|
||||
installbuilddir=@installbuilddir@
|
||||
|
||||
@ -92,8 +93,6 @@ install: $(TARGETS)
|
||||
$(INSTALL_DATA) $(top_srcdir)/build/$${f} $(DESTDIR)$(installbuilddir); \
|
||||
done
|
||||
$(INSTALL_DATA) build/apr_rules.out $(DESTDIR)$(installbuilddir)/apr_rules.mk
|
||||
$(INSTALL_DATA) $(top_srcdir)/build/apr_common.m4 $(DESTDIR)$(installbuilddir)
|
||||
$(INSTALL_DATA) $(top_srcdir)/build/find_apr.m4 $(DESTDIR)$(installbuilddir)
|
||||
$(INSTALL) -m 755 apr-config.out $(DESTDIR)$(bindir)/$(APR_CONFIG)
|
||||
@if [ $(INSTALL_SUBDIRS) != "none" ]; then \
|
||||
for i in $(INSTALL_SUBDIRS); do \
|
||||
|
2
NOTICE
2
NOTICE
@ -1,5 +1,5 @@
|
||||
Apache Portable Runtime
|
||||
Copyright (c) 2000-2018 The Apache Software Foundation.
|
||||
Copyright (c) 2000-2019 The Apache Software Foundation.
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
|
21
apr.dsp
21
apr.dsp
@ -43,7 +43,7 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "LibR"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "./include/private" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@ -67,7 +67,7 @@ LIB32=link.exe -lib
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c
|
||||
# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /EHsc /c
|
||||
# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "./include/private" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /EHsc /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@ -90,7 +90,7 @@ LIB32=link.exe -lib
|
||||
# PROP Intermediate_Dir "x64\LibR"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "./include/private" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@ -114,7 +114,7 @@ LIB32=link.exe -lib
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c
|
||||
# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /EHsc /c
|
||||
# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "./include/private" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\apr-1" /FD /EHsc /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@ -142,6 +142,10 @@ LIB32=link.exe -lib
|
||||
|
||||
SOURCE=.\atomic\win32\apr_atomic.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\atomic\win32\apr_atomic64.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "dso"
|
||||
|
||||
@ -156,6 +160,11 @@ SOURCE=.\dso\win32\dso.c
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\encoding\apr_encode.c
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\encoding\apr_escape.c
|
||||
|
||||
# End Source File
|
||||
@ -426,6 +435,10 @@ SOURCE=.\strings\apr_cpystrn.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\strings\apr_cstr.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\strings\apr_fnmatch.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
2
apr.spec
2
apr.spec
@ -3,7 +3,7 @@
|
||||
|
||||
Summary: Apache Portable Runtime library
|
||||
Name: apr
|
||||
Version: 1.6.5
|
||||
Version: 1.7.0
|
||||
Release: 1
|
||||
License: Apache Software License
|
||||
Group: System Environment/Libraries
|
||||
|
64
atomic/unix/builtins64.c
Normal file
64
atomic/unix/builtins64.c
Normal file
@ -0,0 +1,64 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "apr_arch_atomic.h"
|
||||
|
||||
#ifdef USE_ATOMICS_BUILTINS
|
||||
|
||||
APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem)
|
||||
{
|
||||
return *mem;
|
||||
}
|
||||
|
||||
APR_DECLARE(void) apr_atomic_set64(volatile apr_uint64_t *mem, apr_uint64_t val)
|
||||
{
|
||||
*mem = val;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_uint64_t) apr_atomic_add64(volatile apr_uint64_t *mem, apr_uint64_t val)
|
||||
{
|
||||
return __sync_fetch_and_add(mem, val);
|
||||
}
|
||||
|
||||
APR_DECLARE(void) apr_atomic_sub64(volatile apr_uint64_t *mem, apr_uint64_t val)
|
||||
{
|
||||
__sync_fetch_and_sub(mem, val);
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_uint64_t) apr_atomic_inc64(volatile apr_uint64_t *mem)
|
||||
{
|
||||
return __sync_fetch_and_add(mem, 1);
|
||||
}
|
||||
|
||||
APR_DECLARE(int) apr_atomic_dec64(volatile apr_uint64_t *mem)
|
||||
{
|
||||
return __sync_sub_and_fetch(mem, 1);
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_uint64_t) apr_atomic_cas64(volatile apr_uint64_t *mem, apr_uint64_t with,
|
||||
apr_uint64_t cmp)
|
||||
{
|
||||
return __sync_val_compare_and_swap(mem, cmp, with);
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_uint64_t) apr_atomic_xchg64(volatile apr_uint64_t *mem, apr_uint64_t val)
|
||||
{
|
||||
__sync_synchronize();
|
||||
|
||||
return __sync_lock_test_and_set(mem, val);
|
||||
}
|
||||
|
||||
#endif /* USE_ATOMICS_BUILTINS */
|
@ -20,7 +20,11 @@
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p)
|
||||
{
|
||||
#if defined (NEED_ATOMICS_GENERIC64)
|
||||
return apr__atomic_generic64_init(p);
|
||||
#else
|
||||
return APR_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem)
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#include "apr_arch_atomic.h"
|
||||
#include "apr_thread_mutex.h"
|
||||
|
||||
#ifdef USE_ATOMICS_GENERIC
|
||||
|
||||
@ -70,7 +71,7 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p)
|
||||
}
|
||||
}
|
||||
|
||||
return APR_SUCCESS;
|
||||
return apr__atomic_generic64_init(p);
|
||||
}
|
||||
|
||||
static APR_INLINE apr_thread_mutex_t *mutex_hash(volatile apr_uint32_t *mem)
|
||||
@ -88,7 +89,7 @@ static APR_INLINE apr_thread_mutex_t *mutex_hash(volatile apr_uint32_t *mem)
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p)
|
||||
{
|
||||
return APR_SUCCESS;
|
||||
return apr__atomic_generic64_init(p);
|
||||
}
|
||||
|
||||
#endif /* APR_HAS_THREADS */
|
||||
|
178
atomic/unix/mutex64.c
Normal file
178
atomic/unix/mutex64.c
Normal file
@ -0,0 +1,178 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "apr_arch_atomic.h"
|
||||
#include "apr_thread_mutex.h"
|
||||
|
||||
#if defined(USE_ATOMICS_GENERIC) || defined (NEED_ATOMICS_GENERIC64)
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if APR_HAS_THREADS
|
||||
# define DECLARE_MUTEX_LOCKED(name, mem) \
|
||||
apr_thread_mutex_t *name = mutex_hash(mem)
|
||||
# define MUTEX_UNLOCK(name) \
|
||||
do { \
|
||||
if (apr_thread_mutex_unlock(name) != APR_SUCCESS) \
|
||||
abort(); \
|
||||
} while (0)
|
||||
#else
|
||||
# define DECLARE_MUTEX_LOCKED(name, mem)
|
||||
# define MUTEX_UNLOCK(name)
|
||||
# warning Be warned: using stubs for all atomic operations
|
||||
#endif
|
||||
|
||||
#if APR_HAS_THREADS
|
||||
|
||||
static apr_thread_mutex_t **hash_mutex;
|
||||
|
||||
#define NUM_ATOMIC_HASH 7
|
||||
/* shift by 2 to get rid of alignment issues */
|
||||
#define ATOMIC_HASH(x) (unsigned int)(((unsigned long)(x)>>2)%(unsigned int)NUM_ATOMIC_HASH)
|
||||
|
||||
static apr_status_t atomic_cleanup(void *data)
|
||||
{
|
||||
if (hash_mutex == data)
|
||||
hash_mutex = NULL;
|
||||
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
apr_status_t apr__atomic_generic64_init(apr_pool_t *p)
|
||||
{
|
||||
int i;
|
||||
apr_status_t rv;
|
||||
|
||||
if (hash_mutex != NULL)
|
||||
return APR_SUCCESS;
|
||||
|
||||
hash_mutex = apr_palloc(p, sizeof(apr_thread_mutex_t*) * NUM_ATOMIC_HASH);
|
||||
apr_pool_cleanup_register(p, hash_mutex, atomic_cleanup,
|
||||
apr_pool_cleanup_null);
|
||||
|
||||
for (i = 0; i < NUM_ATOMIC_HASH; i++) {
|
||||
rv = apr_thread_mutex_create(&(hash_mutex[i]),
|
||||
APR_THREAD_MUTEX_DEFAULT, p);
|
||||
if (rv != APR_SUCCESS) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
static APR_INLINE apr_thread_mutex_t *mutex_hash(volatile apr_uint64_t *mem)
|
||||
{
|
||||
apr_thread_mutex_t *mutex = hash_mutex[ATOMIC_HASH(mem)];
|
||||
|
||||
if (apr_thread_mutex_lock(mutex) != APR_SUCCESS) {
|
||||
abort();
|
||||
}
|
||||
|
||||
return mutex;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
apr_status_t apr__atomic_generic64_init(apr_pool_t *p)
|
||||
{
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
#endif /* APR_HAS_THREADS */
|
||||
|
||||
APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem)
|
||||
{
|
||||
return *mem;
|
||||
}
|
||||
|
||||
APR_DECLARE(void) apr_atomic_set64(volatile apr_uint64_t *mem, apr_uint64_t val)
|
||||
{
|
||||
DECLARE_MUTEX_LOCKED(mutex, mem);
|
||||
|
||||
*mem = val;
|
||||
|
||||
MUTEX_UNLOCK(mutex);
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_uint64_t) apr_atomic_add64(volatile apr_uint64_t *mem, apr_uint64_t val)
|
||||
{
|
||||
apr_uint64_t old_value;
|
||||
DECLARE_MUTEX_LOCKED(mutex, mem);
|
||||
|
||||
old_value = *mem;
|
||||
*mem += val;
|
||||
|
||||
MUTEX_UNLOCK(mutex);
|
||||
|
||||
return old_value;
|
||||
}
|
||||
|
||||
APR_DECLARE(void) apr_atomic_sub64(volatile apr_uint64_t *mem, apr_uint64_t val)
|
||||
{
|
||||
DECLARE_MUTEX_LOCKED(mutex, mem);
|
||||
*mem -= val;
|
||||
MUTEX_UNLOCK(mutex);
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_uint64_t) apr_atomic_inc64(volatile apr_uint64_t *mem)
|
||||
{
|
||||
return apr_atomic_add64(mem, 1);
|
||||
}
|
||||
|
||||
APR_DECLARE(int) apr_atomic_dec64(volatile apr_uint64_t *mem)
|
||||
{
|
||||
apr_uint64_t new;
|
||||
DECLARE_MUTEX_LOCKED(mutex, mem);
|
||||
|
||||
(*mem)--;
|
||||
new = *mem;
|
||||
|
||||
MUTEX_UNLOCK(mutex);
|
||||
|
||||
return new;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_uint64_t) apr_atomic_cas64(volatile apr_uint64_t *mem, apr_uint64_t with,
|
||||
apr_uint64_t cmp)
|
||||
{
|
||||
apr_uint64_t prev;
|
||||
DECLARE_MUTEX_LOCKED(mutex, mem);
|
||||
|
||||
prev = *mem;
|
||||
if (prev == cmp) {
|
||||
*mem = with;
|
||||
}
|
||||
|
||||
MUTEX_UNLOCK(mutex);
|
||||
|
||||
return prev;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_uint64_t) apr_atomic_xchg64(volatile apr_uint64_t *mem, apr_uint64_t val)
|
||||
{
|
||||
apr_uint64_t prev;
|
||||
DECLARE_MUTEX_LOCKED(mutex, mem);
|
||||
|
||||
prev = *mem;
|
||||
*mem = val;
|
||||
|
||||
MUTEX_UNLOCK(mutex);
|
||||
|
||||
return prev;
|
||||
}
|
||||
|
||||
#endif /* USE_ATOMICS_GENERIC64 */
|
@ -26,7 +26,11 @@
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p)
|
||||
{
|
||||
#if defined (NEED_ATOMICS_GENERIC64)
|
||||
return apr__atomic_generic64_init(p);
|
||||
#else
|
||||
return APR_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem)
|
||||
|
@ -20,7 +20,11 @@
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p)
|
||||
{
|
||||
#if defined (NEED_ATOMICS_GENERIC64)
|
||||
return apr__atomic_generic64_init(p);
|
||||
#else
|
||||
return APR_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem)
|
||||
|
@ -22,7 +22,11 @@
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p)
|
||||
{
|
||||
#if defined (NEED_ATOMICS_GENERIC64)
|
||||
return apr__atomic_generic64_init(p);
|
||||
#else
|
||||
return APR_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem)
|
||||
|
@ -1,31 +1,32 @@
|
||||
# DO NOT EDIT. AUTOMATICALLY GENERATED.
|
||||
|
||||
encoding/apr_escape.lo: encoding/apr_escape.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_escape.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
passwd/apr_getpass.lo: passwd/apr_getpass.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
strings/apr_cpystrn.lo: strings/apr_cpystrn.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
strings/apr_cstr.lo: strings/apr_cstr.c .make.dirs include/apr_allocator.h include/apr_cstr.h include/apr_errno.h include/apr_fnmatch.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_want.h
|
||||
encoding/apr_encode.lo: encoding/apr_encode.c .make.dirs include/apr_allocator.h include/apr_encode.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
encoding/apr_escape.lo: encoding/apr_escape.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_escape.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
passwd/apr_getpass.lo: passwd/apr_getpass.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
strings/apr_cpystrn.lo: strings/apr_cpystrn.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
strings/apr_cstr.lo: strings/apr_cstr.c .make.dirs include/apr_allocator.h include/apr_cstr.h include/apr_errno.h include/apr_fnmatch.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
strings/apr_fnmatch.lo: strings/apr_fnmatch.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_file_info.h include/apr_fnmatch.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
strings/apr_snprintf.lo: strings/apr_snprintf.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_lib.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
strings/apr_strings.lo: strings/apr_strings.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
strings/apr_strnatcmp.lo: strings/apr_strnatcmp.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
strings/apr_strtok.lo: strings/apr_strtok.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
strings/apr_strings.lo: strings/apr_strings.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
strings/apr_strnatcmp.lo: strings/apr_strnatcmp.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
strings/apr_strtok.lo: strings/apr_strtok.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
tables/apr_hash.lo: tables/apr_hash.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_hash.h include/apr_pools.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
tables/apr_skiplist.lo: tables/apr_skiplist.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_skiplist.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
tables/apr_tables.lo: tables/apr_tables.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_want.h
|
||||
tables/apr_tables.lo: tables/apr_tables.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
|
||||
OBJECTS_all = encoding/apr_escape.lo passwd/apr_getpass.lo strings/apr_cpystrn.lo strings/apr_cstr.lo strings/apr_fnmatch.lo strings/apr_snprintf.lo strings/apr_strings.lo strings/apr_strnatcmp.lo strings/apr_strtok.lo tables/apr_hash.lo tables/apr_skiplist.lo tables/apr_tables.lo
|
||||
OBJECTS_all = encoding/apr_encode.lo encoding/apr_escape.lo passwd/apr_getpass.lo strings/apr_cpystrn.lo strings/apr_cstr.lo strings/apr_fnmatch.lo strings/apr_snprintf.lo strings/apr_strings.lo strings/apr_strnatcmp.lo strings/apr_strtok.lo tables/apr_hash.lo tables/apr_skiplist.lo tables/apr_tables.lo
|
||||
|
||||
dso/unix/dso.lo: dso/unix/dso.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
|
||||
OBJECTS_dso_unix = dso/unix/dso.lo
|
||||
|
||||
file_io/unix/buffer.lo: file_io/unix/buffer.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_thread_mutex.h include/apr_want.h
|
||||
file_io/unix/buffer.lo: file_io/unix/buffer.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
file_io/unix/copy.lo: file_io/unix/copy.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_inherit.h include/apr_pools.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
file_io/unix/dir.lo: file_io/unix/dir.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
file_io/unix/fileacc.lo: file_io/unix/fileacc.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
file_io/unix/fileacc.lo: file_io/unix/fileacc.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
file_io/unix/filedup.lo: file_io/unix/filedup.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
file_io/unix/filepath.lo: file_io/unix/filepath.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_inherit.h include/apr_pools.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
file_io/unix/filepath_util.lo: file_io/unix/filepath_util.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_want.h
|
||||
file_io/unix/filepath_util.lo: file_io/unix/filepath_util.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
file_io/unix/filestat.lo: file_io/unix/filestat.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_inherit.h include/apr_pools.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
file_io/unix/flock.lo: file_io/unix/flock.c .make.dirs
|
||||
file_io/unix/fullrw.lo: file_io/unix/fullrw.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_inherit.h include/apr_pools.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
@ -39,7 +40,7 @@ file_io/unix/tempdir.lo: file_io/unix/tempdir.c .make.dirs include/apr_allocator
|
||||
OBJECTS_file_io_unix = file_io/unix/buffer.lo file_io/unix/copy.lo file_io/unix/dir.lo file_io/unix/fileacc.lo file_io/unix/filedup.lo file_io/unix/filepath.lo file_io/unix/filepath_util.lo file_io/unix/filestat.lo file_io/unix/flock.lo file_io/unix/fullrw.lo file_io/unix/mktemp.lo file_io/unix/open.lo file_io/unix/pipe.lo file_io/unix/readwrite.lo file_io/unix/seek.lo file_io/unix/tempdir.lo
|
||||
|
||||
locks/unix/global_mutex.lo: locks/unix/global_mutex.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
locks/unix/proc_mutex.lo: locks/unix/proc_mutex.c .make.dirs include/apr_allocator.h include/apr_atomic.h include/apr_errno.h include/apr_general.h include/apr_hash.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
locks/unix/proc_mutex.lo: locks/unix/proc_mutex.c .make.dirs include/apr_allocator.h include/apr_atomic.h include/apr_errno.h include/apr_general.h include/apr_hash.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
locks/unix/thread_cond.lo: locks/unix/thread_cond.c .make.dirs
|
||||
locks/unix/thread_mutex.lo: locks/unix/thread_mutex.c .make.dirs include/apr_want.h
|
||||
locks/unix/thread_rwlock.lo: locks/unix/thread_rwlock.c .make.dirs
|
||||
@ -51,13 +52,13 @@ memory/unix/apr_pools.lo: memory/unix/apr_pools.c .make.dirs include/apr_allocat
|
||||
OBJECTS_memory_unix = memory/unix/apr_pools.lo
|
||||
|
||||
misc/unix/charset.lo: misc/unix/charset.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
misc/unix/env.lo: misc/unix/env.c .make.dirs include/apr_allocator.h include/apr_env.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
misc/unix/errorcodes.lo: misc/unix/errorcodes.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
misc/unix/getopt.lo: misc/unix/getopt.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
misc/unix/env.lo: misc/unix/env.c .make.dirs include/apr_allocator.h include/apr_env.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
misc/unix/errorcodes.lo: misc/unix/errorcodes.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
misc/unix/getopt.lo: misc/unix/getopt.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
misc/unix/otherchild.lo: misc/unix/otherchild.c .make.dirs
|
||||
misc/unix/rand.lo: misc/unix/rand.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_thread_mutex.h include/apr_want.h
|
||||
misc/unix/start.lo: misc/unix/start.c .make.dirs include/apr_allocator.h include/apr_atomic.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_signal.h include/apr_thread_mutex.h include/apr_want.h
|
||||
misc/unix/version.lo: misc/unix/version.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_thread_mutex.h include/apr_version.h include/apr_want.h
|
||||
misc/unix/rand.lo: misc/unix/rand.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
misc/unix/start.lo: misc/unix/start.c .make.dirs include/apr_allocator.h include/apr_atomic.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_signal.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
misc/unix/version.lo: misc/unix/version.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_thread_mutex.h include/apr_time.h include/apr_version.h include/apr_want.h
|
||||
|
||||
OBJECTS_misc_unix = misc/unix/charset.lo misc/unix/env.lo misc/unix/errorcodes.lo misc/unix/getopt.lo misc/unix/otherchild.lo misc/unix/rand.lo misc/unix/start.lo misc/unix/version.lo
|
||||
|
||||
@ -66,14 +67,14 @@ mmap/unix/mmap.lo: mmap/unix/mmap.c .make.dirs include/apr_allocator.h include/a
|
||||
|
||||
OBJECTS_mmap_unix = mmap/unix/common.lo mmap/unix/mmap.lo
|
||||
|
||||
network_io/unix/inet_ntop.lo: network_io/unix/inet_ntop.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
network_io/unix/inet_ntop.lo: network_io/unix/inet_ntop.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
network_io/unix/inet_pton.lo: network_io/unix/inet_pton.c .make.dirs
|
||||
network_io/unix/multicast.lo: network_io/unix/multicast.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_support.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
network_io/unix/sendrecv.lo: network_io/unix/sendrecv.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_support.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
network_io/unix/sockaddr.lo: network_io/unix/sockaddr.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
network_io/unix/sockaddr.lo: network_io/unix/sockaddr.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
network_io/unix/socket_util.lo: network_io/unix/socket_util.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_poll.h include/apr_pools.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
network_io/unix/sockets.lo: network_io/unix/sockets.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_strings.h include/apr_support.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
network_io/unix/sockopt.lo: network_io/unix/sockopt.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
network_io/unix/sockopt.lo: network_io/unix/sockopt.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
|
||||
OBJECTS_network_io_unix = network_io/unix/inet_ntop.lo network_io/unix/inet_pton.lo network_io/unix/multicast.lo network_io/unix/sendrecv.lo network_io/unix/sockaddr.lo network_io/unix/socket_util.lo network_io/unix/sockets.lo network_io/unix/sockopt.lo
|
||||
|
||||
@ -95,7 +96,7 @@ random/unix/sha2_glue.lo: random/unix/sha2_glue.c .make.dirs include/apr_allocat
|
||||
|
||||
OBJECTS_random_unix = random/unix/apr_random.lo random/unix/sha2.lo random/unix/sha2_glue.lo
|
||||
|
||||
shmem/unix/shm.lo: shmem/unix/shm.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_hash.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_user.h include/apr_want.h
|
||||
shmem/unix/shm.lo: shmem/unix/shm.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_hash.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
|
||||
OBJECTS_shmem_unix = shmem/unix/shm.lo
|
||||
|
||||
@ -105,7 +106,7 @@ OBJECTS_support_unix = support/unix/waitio.lo
|
||||
|
||||
threadproc/unix/proc.lo: threadproc/unix/proc.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_random.h include/apr_shm.h include/apr_signal.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
threadproc/unix/procsup.lo: threadproc/unix/procsup.c .make.dirs
|
||||
threadproc/unix/signals.lo: threadproc/unix/signals.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_signal.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
threadproc/unix/signals.lo: threadproc/unix/signals.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_signal.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
threadproc/unix/thread.lo: threadproc/unix/thread.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
threadproc/unix/threadpriv.lo: threadproc/unix/threadpriv.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
|
||||
@ -122,13 +123,15 @@ user/unix/userinfo.lo: user/unix/userinfo.c .make.dirs include/apr_allocator.h i
|
||||
OBJECTS_user_unix = user/unix/groupinfo.lo user/unix/userinfo.lo
|
||||
|
||||
atomic/unix/builtins.lo: atomic/unix/builtins.c .make.dirs
|
||||
atomic/unix/builtins64.lo: atomic/unix/builtins64.c .make.dirs
|
||||
atomic/unix/ia32.lo: atomic/unix/ia32.c .make.dirs
|
||||
atomic/unix/mutex.lo: atomic/unix/mutex.c .make.dirs
|
||||
atomic/unix/mutex.lo: atomic/unix/mutex.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
atomic/unix/mutex64.lo: atomic/unix/mutex64.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
atomic/unix/ppc.lo: atomic/unix/ppc.c .make.dirs
|
||||
atomic/unix/s390.lo: atomic/unix/s390.c .make.dirs
|
||||
atomic/unix/solaris.lo: atomic/unix/solaris.c .make.dirs
|
||||
|
||||
OBJECTS_atomic_unix = atomic/unix/builtins.lo atomic/unix/ia32.lo atomic/unix/mutex.lo atomic/unix/ppc.lo atomic/unix/s390.lo atomic/unix/solaris.lo
|
||||
OBJECTS_atomic_unix = atomic/unix/builtins.lo atomic/unix/builtins64.lo atomic/unix/ia32.lo atomic/unix/mutex.lo atomic/unix/mutex64.lo atomic/unix/ppc.lo atomic/unix/s390.lo atomic/unix/solaris.lo
|
||||
|
||||
OBJECTS_unix = $(OBJECTS_all) $(OBJECTS_atomic_unix) $(OBJECTS_dso_unix) $(OBJECTS_file_io_unix) $(OBJECTS_locks_unix) $(OBJECTS_memory_unix) $(OBJECTS_misc_unix) $(OBJECTS_mmap_unix) $(OBJECTS_network_io_unix) $(OBJECTS_poll_unix) $(OBJECTS_random_unix) $(OBJECTS_shmem_unix) $(OBJECTS_support_unix) $(OBJECTS_threadproc_unix) $(OBJECTS_time_unix) $(OBJECTS_user_unix)
|
||||
|
||||
@ -159,7 +162,7 @@ shmem/beos/shm.lo: shmem/beos/shm.c .make.dirs include/apr_allocator.h include/a
|
||||
OBJECTS_shmem_beos = shmem/beos/shm.lo
|
||||
|
||||
threadproc/beos/apr_proc_stub.lo: threadproc/beos/apr_proc_stub.c .make.dirs
|
||||
threadproc/beos/proc.lo: threadproc/beos/proc.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
threadproc/beos/proc.lo: threadproc/beos/proc.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
threadproc/beos/thread.lo: threadproc/beos/thread.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
threadproc/beos/threadpriv.lo: threadproc/beos/threadpriv.c .make.dirs
|
||||
threadproc/beos/threadproc_common.lo: threadproc/beos/threadproc_common.c .make.dirs
|
||||
@ -172,7 +175,7 @@ dso/os2/dso.lo: dso/os2/dso.c .make.dirs include/apr_allocator.h include/apr_dso
|
||||
|
||||
OBJECTS_dso_os2 = dso/os2/dso.lo
|
||||
|
||||
file_io/os2/buffer.lo: file_io/os2/buffer.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_thread_mutex.h include/apr_want.h
|
||||
file_io/os2/buffer.lo: file_io/os2/buffer.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
file_io/os2/copy.lo: file_io/os2/copy.c .make.dirs
|
||||
file_io/os2/dir.lo: file_io/os2/dir.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_lib.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
file_io/os2/dir_make_recurse.lo: file_io/os2/dir_make_recurse.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_inherit.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
@ -181,7 +184,7 @@ file_io/os2/filedup.lo: file_io/os2/filedup.c .make.dirs include/apr_allocator.h
|
||||
file_io/os2/filepath.lo: file_io/os2/filepath.c .make.dirs
|
||||
file_io/os2/filepath_util.lo: file_io/os2/filepath_util.c .make.dirs
|
||||
file_io/os2/filestat.lo: file_io/os2/filestat.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_inherit.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
file_io/os2/filesys.lo: file_io/os2/filesys.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
file_io/os2/filesys.lo: file_io/os2/filesys.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
file_io/os2/flock.lo: file_io/os2/flock.c .make.dirs
|
||||
file_io/os2/fullrw.lo: file_io/os2/fullrw.c .make.dirs
|
||||
file_io/os2/maperrorcode.lo: file_io/os2/maperrorcode.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_inherit.h include/apr_pools.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
@ -235,22 +238,22 @@ dso/os390/dso.lo: dso/os390/dso.c .make.dirs include/apr_allocator.h include/apr
|
||||
|
||||
OBJECTS_dso_os390 = dso/os390/dso.lo
|
||||
|
||||
atomic/os390/atomic.lo: atomic/os390/atomic.c .make.dirs include/apr_allocator.h include/apr_atomic.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_thread_mutex.h include/apr_want.h
|
||||
atomic/os390/atomic.lo: atomic/os390/atomic.c .make.dirs
|
||||
|
||||
OBJECTS_atomic_os390 = atomic/os390/atomic.lo
|
||||
|
||||
OBJECTS_os390 = $(OBJECTS_all) $(OBJECTS_atomic_os390) $(OBJECTS_dso_os390) $(OBJECTS_file_io_unix) $(OBJECTS_locks_unix) $(OBJECTS_memory_unix) $(OBJECTS_misc_unix) $(OBJECTS_mmap_unix) $(OBJECTS_network_io_unix) $(OBJECTS_poll_unix) $(OBJECTS_random_unix) $(OBJECTS_shmem_unix) $(OBJECTS_support_unix) $(OBJECTS_threadproc_unix) $(OBJECTS_time_unix) $(OBJECTS_user_unix)
|
||||
|
||||
dso/win32/dso.lo: dso/win32/dso.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
dso/win32/dso.lo: dso/win32/dso.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
|
||||
OBJECTS_dso_win32 = dso/win32/dso.lo
|
||||
|
||||
file_io/win32/buffer.lo: file_io/win32/buffer.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_thread_mutex.h include/apr_want.h
|
||||
file_io/win32/buffer.lo: file_io/win32/buffer.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
file_io/win32/dir.lo: file_io/win32/dir.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
file_io/win32/filedup.lo: file_io/win32/filedup.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_inherit.h include/apr_pools.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
file_io/win32/filepath.lo: file_io/win32/filepath.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
file_io/win32/filepath.lo: file_io/win32/filepath.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_lib.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
file_io/win32/filestat.lo: file_io/win32/filestat.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_inherit.h include/apr_pools.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
file_io/win32/filesys.lo: file_io/win32/filesys.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
file_io/win32/filesys.lo: file_io/win32/filesys.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
file_io/win32/flock.lo: file_io/win32/flock.c .make.dirs
|
||||
file_io/win32/open.lo: file_io/win32/open.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
file_io/win32/pipe.lo: file_io/win32/pipe.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_escape.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_inherit.h include/apr_pools.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
@ -267,11 +270,11 @@ locks/win32/thread_rwlock.lo: locks/win32/thread_rwlock.c .make.dirs include/apr
|
||||
OBJECTS_locks_win32 = locks/win32/proc_mutex.lo locks/win32/thread_cond.lo locks/win32/thread_mutex.lo locks/win32/thread_rwlock.lo
|
||||
|
||||
misc/win32/charset.lo: misc/win32/charset.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_strings.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
misc/win32/env.lo: misc/win32/env.c .make.dirs include/apr_allocator.h include/apr_env.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_want.h
|
||||
misc/win32/env.lo: misc/win32/env.c .make.dirs include/apr_allocator.h include/apr_env.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_strings.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
misc/win32/internal.lo: misc/win32/internal.c .make.dirs
|
||||
misc/win32/misc.lo: misc/win32/misc.c .make.dirs include/apr_errno.h include/apr_lib.h
|
||||
misc/win32/rand.lo: misc/win32/rand.c .make.dirs include/apr_allocator.h include/apr_dso.h include/apr_errno.h include/apr_file_info.h include/apr_file_io.h include/apr_general.h include/apr_global_mutex.h include/apr_inherit.h include/apr_network_io.h include/apr_perms_set.h include/apr_pools.h include/apr_portable.h include/apr_proc_mutex.h include/apr_shm.h include/apr_tables.h include/apr_thread_mutex.h include/apr_thread_proc.h include/apr_time.h include/apr_user.h include/apr_want.h
|
||||
misc/win32/start.lo: misc/win32/start.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_signal.h include/apr_thread_mutex.h include/apr_want.h
|
||||
misc/win32/start.lo: misc/win32/start.c .make.dirs include/apr_allocator.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_signal.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
misc/win32/utf8.lo: misc/win32/utf8.c .make.dirs include/apr_errno.h
|
||||
|
||||
OBJECTS_misc_win32 = misc/unix/errorcodes.lo misc/unix/getopt.lo misc/unix/otherchild.lo misc/unix/version.lo misc/win32/charset.lo misc/win32/env.lo misc/win32/internal.lo misc/win32/misc.lo misc/win32/rand.lo misc/win32/start.lo misc/win32/utf8.lo
|
||||
@ -307,15 +310,16 @@ user/win32/userinfo.lo: user/win32/userinfo.c .make.dirs include/apr_allocator.h
|
||||
|
||||
OBJECTS_user_win32 = user/win32/groupinfo.lo user/win32/userinfo.lo
|
||||
|
||||
atomic/win32/apr_atomic.lo: atomic/win32/apr_atomic.c .make.dirs include/apr_allocator.h include/apr_atomic.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_thread_mutex.h include/apr_want.h
|
||||
atomic/win32/apr_atomic.lo: atomic/win32/apr_atomic.c .make.dirs
|
||||
atomic/win32/apr_atomic64.lo: atomic/win32/apr_atomic64.c .make.dirs include/apr_allocator.h include/apr_atomic.h include/apr_errno.h include/apr_general.h include/apr_pools.h include/apr_thread_mutex.h include/apr_time.h include/apr_want.h
|
||||
|
||||
OBJECTS_atomic_win32 = atomic/win32/apr_atomic.lo
|
||||
OBJECTS_atomic_win32 = atomic/win32/apr_atomic.lo atomic/win32/apr_atomic64.lo
|
||||
|
||||
OBJECTS_win32 = $(OBJECTS_all) $(OBJECTS_atomic_win32) $(OBJECTS_dso_win32) $(OBJECTS_file_io_win32) $(OBJECTS_locks_win32) $(OBJECTS_memory_unix) $(OBJECTS_misc_win32) $(OBJECTS_mmap_win32) $(OBJECTS_network_io_win32) $(OBJECTS_poll_unix) $(OBJECTS_random_unix) $(OBJECTS_shmem_win32) $(OBJECTS_support_unix) $(OBJECTS_threadproc_win32) $(OBJECTS_time_win32) $(OBJECTS_user_win32)
|
||||
|
||||
HEADERS = $(top_srcdir)/include/apr_allocator.h $(top_srcdir)/include/apr_atomic.h $(top_srcdir)/include/apr_cstr.h $(top_srcdir)/include/apr_dso.h $(top_srcdir)/include/apr_env.h $(top_srcdir)/include/apr_errno.h $(top_srcdir)/include/apr_escape.h $(top_srcdir)/include/apr_file_info.h $(top_srcdir)/include/apr_file_io.h $(top_srcdir)/include/apr_fnmatch.h $(top_srcdir)/include/apr_general.h $(top_srcdir)/include/apr_getopt.h $(top_srcdir)/include/apr_global_mutex.h $(top_srcdir)/include/apr_hash.h $(top_srcdir)/include/apr_inherit.h $(top_srcdir)/include/apr_lib.h $(top_srcdir)/include/apr_mmap.h $(top_srcdir)/include/apr_network_io.h $(top_srcdir)/include/apr_perms_set.h $(top_srcdir)/include/apr_poll.h $(top_srcdir)/include/apr_pools.h $(top_srcdir)/include/apr_portable.h $(top_srcdir)/include/apr_proc_mutex.h $(top_srcdir)/include/apr_random.h $(top_srcdir)/include/apr_ring.h $(top_srcdir)/include/apr_shm.h $(top_srcdir)/include/apr_signal.h $(top_srcdir)/include/apr_skiplist.h $(top_srcdir)/include/apr_strings.h $(top_srcdir)/include/apr_support.h $(top_srcdir)/include/apr_tables.h $(top_srcdir)/include/apr_thread_cond.h $(top_srcdir)/include/apr_thread_mutex.h $(top_srcdir)/include/apr_thread_proc.h $(top_srcdir)/include/apr_thread_rwlock.h $(top_srcdir)/include/apr_time.h $(top_srcdir)/include/apr_user.h $(top_srcdir)/include/apr_version.h $(top_srcdir)/include/apr_want.h
|
||||
HEADERS = $(top_srcdir)/include/apr_allocator.h $(top_srcdir)/include/apr_atomic.h $(top_srcdir)/include/apr_cstr.h $(top_srcdir)/include/apr_dso.h $(top_srcdir)/include/apr_encode.h $(top_srcdir)/include/apr_env.h $(top_srcdir)/include/apr_errno.h $(top_srcdir)/include/apr_escape.h $(top_srcdir)/include/apr_file_info.h $(top_srcdir)/include/apr_file_io.h $(top_srcdir)/include/apr_fnmatch.h $(top_srcdir)/include/apr_general.h $(top_srcdir)/include/apr_getopt.h $(top_srcdir)/include/apr_global_mutex.h $(top_srcdir)/include/apr_hash.h $(top_srcdir)/include/apr_inherit.h $(top_srcdir)/include/apr_lib.h $(top_srcdir)/include/apr_mmap.h $(top_srcdir)/include/apr_network_io.h $(top_srcdir)/include/apr_perms_set.h $(top_srcdir)/include/apr_poll.h $(top_srcdir)/include/apr_pools.h $(top_srcdir)/include/apr_portable.h $(top_srcdir)/include/apr_proc_mutex.h $(top_srcdir)/include/apr_random.h $(top_srcdir)/include/apr_ring.h $(top_srcdir)/include/apr_shm.h $(top_srcdir)/include/apr_signal.h $(top_srcdir)/include/apr_skiplist.h $(top_srcdir)/include/apr_strings.h $(top_srcdir)/include/apr_support.h $(top_srcdir)/include/apr_tables.h $(top_srcdir)/include/apr_thread_cond.h $(top_srcdir)/include/apr_thread_mutex.h $(top_srcdir)/include/apr_thread_proc.h $(top_srcdir)/include/apr_thread_rwlock.h $(top_srcdir)/include/apr_time.h $(top_srcdir)/include/apr_user.h $(top_srcdir)/include/apr_version.h $(top_srcdir)/include/apr_want.h
|
||||
|
||||
SOURCE_DIRS = random/unix misc/win32 encoding dso/os2 time/unix network_io/win32 dso/win32 locks/unix user/unix time/win32 locks/beos tables support/unix file_io/unix mmap/unix atomic/unix threadproc/win32 poll/os2 atomic/win32 dso/os390 atomic/os390 dso/beos poll/unix passwd network_io/beos threadproc/os2 network_io/os2 shmem/win32 threadproc/beos shmem/unix network_io/unix file_io/os2 mmap/win32 dso/aix file_io/win32 threadproc/unix misc/unix locks/win32 shmem/beos dso/unix locks/os2 user/win32 shmem/os2 memory/unix strings $(EXTRA_SOURCE_DIRS)
|
||||
SOURCE_DIRS = encoding passwd strings tables dso/unix file_io/unix locks/unix memory/unix misc/unix mmap/unix network_io/unix poll/unix random/unix shmem/unix support/unix threadproc/unix time/unix user/unix atomic/unix dso/aix dso/beos locks/beos network_io/beos shmem/beos threadproc/beos dso/os2 file_io/os2 locks/os2 network_io/os2 poll/os2 shmem/os2 threadproc/os2 dso/os390 atomic/os390 dso/win32 file_io/win32 locks/win32 misc/win32 mmap/win32 network_io/win32 shmem/win32 threadproc/win32 time/win32 user/win32 atomic/win32 $(EXTRA_SOURCE_DIRS)
|
||||
|
||||
BUILD_DIRS = atomic atomic/os390 atomic/unix atomic/win32 dso dso/aix dso/beos dso/os2 dso/os390 dso/unix dso/win32 encoding file_io file_io/os2 file_io/unix file_io/win32 locks locks/beos locks/os2 locks/unix locks/win32 memory memory/unix misc misc/unix misc/win32 mmap mmap/unix mmap/win32 network_io network_io/beos network_io/os2 network_io/unix network_io/win32 passwd poll poll/os2 poll/unix random random/unix shmem shmem/beos shmem/os2 shmem/unix shmem/win32 strings support support/unix tables threadproc threadproc/beos threadproc/os2 threadproc/unix threadproc/win32 time time/unix time/win32 user user/unix user/win32
|
||||
|
||||
|
@ -112,8 +112,10 @@ ${AUTOCONF:-autoconf} $verbose
|
||||
# Remove autoconf 2.5x's cache directory
|
||||
rm -rf autom4te*.cache
|
||||
|
||||
PYTHON=${PYTHON-`build/PrintPath python3 python2 python`}
|
||||
|
||||
echo "buildconf: generating 'make' outputs ..."
|
||||
build/gen-build.py $verbose make
|
||||
${PYTHON} build/gen-build.py $verbose make
|
||||
|
||||
# Create RPM Spec file
|
||||
if [ -f `which cut` ]; then
|
||||
|
177
configure.in
177
configure.in
@ -264,8 +264,11 @@ case $host in
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
AC_PROG_LIBTOOL
|
||||
# get libtool's setting of shlibpath_var
|
||||
eval `grep "^shlibpath_var=[[A-Z_]]*$" $apr_builddir/libtool`
|
||||
if test "x$shlibpath_var" = "x"; then
|
||||
eval `grep "^shlibpath_var=[[A-Z_]]*$" $apr_builddir/libtool`
|
||||
fi
|
||||
if test "x$shlibpath_var" = "x"; then
|
||||
AC_MSG_NOTICE([SHLIBPATH variable could not be determined])
|
||||
shlibpath_var=REPLACE_WITH_YOUR_SHLIBPATH_VAR
|
||||
fi
|
||||
fi
|
||||
@ -807,15 +810,13 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
ac_cv_define_READDIR_IS_THREAD_SAFE=no
|
||||
ac_cv_define_READDIR_IS_THREAD_SAFE=yes
|
||||
ac_cv_define_GETHOSTBYNAME_IS_THREAD_SAFE=no
|
||||
ac_cv_define_GETHOSTBYADDR_IS_THREAD_SAFE=no
|
||||
ac_cv_define_GETSERVBYNAME_IS_THREAD_SAFE=no
|
||||
if test "$threads" = "1"; then
|
||||
echo "APR will use threads"
|
||||
AC_CHECK_LIB(c_r, readdir,
|
||||
AC_DEFINE(READDIR_IS_THREAD_SAFE, 1,
|
||||
[Define if readdir is thread safe]))
|
||||
AC_DEFINE(READDIR_IS_THREAD_SAFE, 1, [Modern readdir is thread safe])
|
||||
if test "x$apr_gethostbyname_is_thread_safe" = "x"; then
|
||||
AC_CHECK_LIB(c_r, gethostbyname, apr_gethostbyname_is_thread_safe=yes)
|
||||
fi
|
||||
@ -1490,6 +1491,7 @@ APR_FLAG_HEADERS(
|
||||
errno.h \
|
||||
fcntl.h \
|
||||
grp.h \
|
||||
inttypes.h \
|
||||
io.h \
|
||||
limits.h \
|
||||
mach-o/dyld.h \
|
||||
@ -1569,6 +1571,7 @@ AC_SUBST(crypth)
|
||||
AC_SUBST(errnoh)
|
||||
AC_SUBST(direnth)
|
||||
AC_SUBST(fcntlh)
|
||||
AC_SUBST(inttypesh)
|
||||
AC_SUBST(ioh)
|
||||
AC_SUBST(limitsh)
|
||||
AC_SUBST(netdbh)
|
||||
@ -1664,9 +1667,9 @@ fi
|
||||
|
||||
dnl Checks for integer size
|
||||
AC_CHECK_SIZEOF(char, 1)
|
||||
AC_CHECK_SIZEOF(short, 2)
|
||||
AC_CHECK_SIZEOF(int, 4)
|
||||
AC_CHECK_SIZEOF(long, 4)
|
||||
AC_CHECK_SIZEOF(short, 2)
|
||||
AC_CHECK_SIZEOF(long long, 8)
|
||||
|
||||
if test "$ac_cv_sizeof_short" = "2"; then
|
||||
@ -1675,16 +1678,37 @@ fi
|
||||
if test "$ac_cv_sizeof_int" = "4"; then
|
||||
int_value=int
|
||||
fi
|
||||
|
||||
# Now we need to find what apr_int64_t (sizeof == 8) will be.
|
||||
# The first match is our preference.
|
||||
if test "$ac_cv_sizeof_int" = "8"; then
|
||||
# The first match is our preference (use inttypes if available).
|
||||
APR_IFALLYES(header:stdint.h header:inttypes.h, hasinttypes="1", hasinttypes="0")
|
||||
if test "$hasinttypes" = "1"; then
|
||||
int64_literal='#define APR_INT64_C(val) INT64_C(val)'
|
||||
uint64_literal='#define APR_UINT64_C(val) UINT64_C(val)'
|
||||
int64_t_fmt='#define APR_INT64_T_FMT PRId64'
|
||||
uint64_t_fmt='#define APR_UINT64_T_FMT PRIu64'
|
||||
uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT PRIx64'
|
||||
int64_value="int64_t"
|
||||
uint64_value="uint64_t"
|
||||
APR_CHECK_TYPES_FMT_COMPATIBLE(int64_t, int, d, [
|
||||
int64_strfn="strtoi"
|
||||
], [
|
||||
APR_CHECK_TYPES_FMT_COMPATIBLE(int64_t, long, ld, [
|
||||
int64_strfn="strtol"
|
||||
], [
|
||||
APR_CHECK_TYPES_FMT_COMPATIBLE(int64_t, long long, lld, [
|
||||
int64_strfn="strtoll"
|
||||
], [
|
||||
AC_ERROR([could not determine the string function for int64_t])
|
||||
])])])
|
||||
elif test "$ac_cv_sizeof_int" = "8"; then
|
||||
int64_literal='#define APR_INT64_C(val) (val)'
|
||||
uint64_literal='#define APR_UINT64_C(val) (val##U)'
|
||||
int64_t_fmt='#define APR_INT64_T_FMT "d"'
|
||||
uint64_t_fmt='#define APR_UINT64_T_FMT "u"'
|
||||
uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "x"'
|
||||
int64_value="int"
|
||||
long_value=int
|
||||
uint64_value="unsigned int"
|
||||
int64_strfn="strtoi"
|
||||
elif test "$ac_cv_sizeof_long" = "8"; then
|
||||
int64_literal='#define APR_INT64_C(val) (val##L)'
|
||||
@ -1693,7 +1717,7 @@ elif test "$ac_cv_sizeof_long" = "8"; then
|
||||
uint64_t_fmt='#define APR_UINT64_T_FMT "lu"'
|
||||
uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "lx"'
|
||||
int64_value="long"
|
||||
long_value=long
|
||||
uint64_value="unsigned long"
|
||||
int64_strfn="strtol"
|
||||
elif test "$ac_cv_sizeof_long_long" = "8"; then
|
||||
int64_literal='#define APR_INT64_C(val) (val##LL)'
|
||||
@ -1706,7 +1730,7 @@ elif test "$ac_cv_sizeof_long_long" = "8"; then
|
||||
uint64_t_fmt='#define APR_UINT64_T_FMT "llu"'
|
||||
uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "llx"'
|
||||
int64_value="long long"
|
||||
long_value="long long"
|
||||
uint64_value="unsigned long long"
|
||||
int64_strfn="strtoll"
|
||||
elif test "$ac_cv_sizeof_longlong" = "8"; then
|
||||
int64_literal='#define APR_INT64_C(val) (val##LL)'
|
||||
@ -1715,7 +1739,7 @@ elif test "$ac_cv_sizeof_longlong" = "8"; then
|
||||
uint64_t_fmt='#define APR_UINT64_T_FMT "qu"'
|
||||
uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "qx"'
|
||||
int64_value="__int64"
|
||||
long_value="__int64"
|
||||
uint64_value="unsigned __int64"
|
||||
int64_strfn="strtoll"
|
||||
else
|
||||
# int64_literal may be overriden if your compiler thinks you have
|
||||
@ -1833,18 +1857,22 @@ case $host in
|
||||
uint64_t_fmt='#define APR_UINT64_T_FMT "I64u"'
|
||||
uint64_t_hex_fmt='#define APR_UINT64_T_HEX_FMT "I64x"'
|
||||
int64_value="__int64"
|
||||
long_value="__int64"
|
||||
uint64_value="unsigned __int64"
|
||||
int64_strfn="_strtoi64"
|
||||
;;
|
||||
esac
|
||||
|
||||
APR_CHECK_TYPES_COMPATIBLE(ssize_t, int, [ssize_t_fmt="d"])
|
||||
APR_CHECK_TYPES_COMPATIBLE(ssize_t, long, [ssize_t_fmt="ld"])
|
||||
APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned int, [size_t_fmt="u"])
|
||||
APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned long, [size_t_fmt="lu"])
|
||||
dnl I would expect much of the above to go away with new compile test
|
||||
APR_CHECK_TYPES_FMT_COMPATIBLE(ssize_t, long, ld, [ssize_t_fmt="ld"], [
|
||||
APR_CHECK_TYPES_FMT_COMPATIBLE(ssize_t, int, d, [ssize_t_fmt="d"])
|
||||
])
|
||||
APR_CHECK_TYPES_FMT_COMPATIBLE(size_t, unsigned long, lu, [size_t_fmt="lu"], [
|
||||
APR_CHECK_TYPES_FMT_COMPATIBLE(size_t, unsigned int, u, [size_t_fmt="u"])
|
||||
])
|
||||
|
||||
APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
|
||||
|
||||
dnl the else cases below should no longer occur;
|
||||
AC_MSG_CHECKING([which format to use for apr_ssize_t])
|
||||
if test -n "$ssize_t_fmt"; then
|
||||
AC_MSG_RESULT(%$ssize_t_fmt)
|
||||
@ -1862,6 +1890,7 @@ ssize_t_fmt="#define APR_SSIZE_T_FMT \"$ssize_t_fmt\""
|
||||
|
||||
APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)
|
||||
|
||||
# else cases below should no longer occur;
|
||||
AC_MSG_CHECKING([which format to use for apr_size_t])
|
||||
if test -n "$size_t_fmt"; then
|
||||
AC_MSG_RESULT(%$size_t_fmt)
|
||||
@ -1914,21 +1943,24 @@ elif test "${ac_cv_sizeof_off_t}x${ac_cv_sizeof_long}" = "4x4"; then
|
||||
off_t_fmt='#define APR_OFF_T_FMT "ld"'
|
||||
off_t_strfn='strtol'
|
||||
elif test "$ac_cv_type_off_t" = "yes"; then
|
||||
off_t_value=off_t
|
||||
# off_t is more commonly a long than an int; prefer that case
|
||||
# where int and long are the same size.
|
||||
if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then
|
||||
off_t_fmt='#define APR_OFF_T_FMT "ld"'
|
||||
# where int and long are the same size and interchangable.
|
||||
off_t_value=off_t
|
||||
APR_CHECK_TYPES_FMT_COMPATIBLE(off_t, long, ld, [
|
||||
off_t_fmt="#define APR_OFF_T_FMT \"ld\""
|
||||
off_t_strfn='strtol'
|
||||
elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_int"; then
|
||||
off_t_fmt='#define APR_OFF_T_FMT "d"'
|
||||
], [
|
||||
APR_CHECK_TYPES_FMT_COMPATIBLE(off_t, int, d, [
|
||||
off_t_fmt="#define APR_OFF_T_FMT \"d\""
|
||||
off_t_strfn='strtoi'
|
||||
elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then
|
||||
off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT'
|
||||
off_t_strfn='apr_strtoi64'
|
||||
else
|
||||
AC_ERROR([could not determine the size of off_t])
|
||||
fi
|
||||
], [
|
||||
APR_CHECK_TYPES_FMT_COMPATIBLE(off_t, long long, lld, [
|
||||
off_t_fmt="#define APR_OFF_T_FMT \"lld\""
|
||||
off_t_strfn='strtoll'
|
||||
], [
|
||||
APR_CHECK_TYPES_FMT_COMPATIBLE(off_t, $int64_value, I64d, [
|
||||
off_t_fmt="#define APR_OFF_T_FMT APR_INT64_T_FMT"
|
||||
off_t_strfn='apr_strtoi64'], [
|
||||
# Per OS tuning...
|
||||
case $host in
|
||||
*-mingw*)
|
||||
@ -1936,7 +1968,11 @@ elif test "$ac_cv_type_off_t" = "yes"; then
|
||||
off_t_fmt='#define APR_OFF_T_FMT "I64d"'
|
||||
off_t_strfn='_strtoi64'
|
||||
;;
|
||||
*)
|
||||
AC_ERROR([could not determine the size of off_t])
|
||||
;;
|
||||
esac
|
||||
])])])])
|
||||
else
|
||||
# Fallback on int
|
||||
off_t_value=apr_int32_t
|
||||
@ -1995,8 +2031,8 @@ fi
|
||||
AC_SUBST(voidp_size)
|
||||
AC_SUBST(short_value)
|
||||
AC_SUBST(int_value)
|
||||
AC_SUBST(long_value)
|
||||
AC_SUBST(int64_value)
|
||||
AC_SUBST(uint64_value)
|
||||
AC_SUBST(off_t_value)
|
||||
AC_SUBST(size_t_value)
|
||||
AC_SUBST(ssize_t_value)
|
||||
@ -2189,10 +2225,17 @@ AC_SUBST(struct_rlimit)
|
||||
dnl ----------------------------- Checking for Locking Characteristics
|
||||
echo "${nl}Checking for Locking..."
|
||||
|
||||
AC_CHECK_FUNCS(semget semctl flock)
|
||||
AC_CHECK_HEADERS(semaphore.h OS.h)
|
||||
AC_CHECK_FUNCS(semget semctl semop semtimedop flock)
|
||||
APR_IFALLYES(func:semtimedop, have_semtimedop="1", have_semtimedop="0")
|
||||
|
||||
AC_CHECK_HEADERS(semaphore.h)
|
||||
AC_SEARCH_LIBS(sem_open, rt)
|
||||
AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait create_sem)
|
||||
AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait sem_timedwait)
|
||||
APR_IFALLYES(func:sem_timedwait, have_sem_timedwait="1", have_sem_timedwait="0")
|
||||
|
||||
AC_CHECK_HEADERS(OS.h)
|
||||
AC_CHECK_FUNCS(create_sem acquire_sem acquire_sem_etc)
|
||||
APR_IFALLYES(header:OS.h func:acquire_sem_etc, have_acquire_sem_etc="1", have_acquire_sem_etc="0")
|
||||
|
||||
# Some systems return ENOSYS from sem_open.
|
||||
AC_CACHE_CHECK(for working sem_open,ac_cv_func_sem_open,[
|
||||
@ -2251,7 +2294,10 @@ APR_CHECK_DEFINE_FILES(POLLIN, poll.h sys/poll.h)
|
||||
|
||||
if test "$threads" = "1"; then
|
||||
APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h)
|
||||
AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
|
||||
AC_CHECK_FUNCS(pthread_mutex_timedlock pthread_mutexattr_setpshared)
|
||||
APR_IFALLYES(header:pthread.h func:pthread_mutex_timedlock,
|
||||
have_pthread_mutex_timedlock="1", have_pthread_mutex_timedlock="0")
|
||||
AC_SUBST(have_pthread_mutex_timedlock)
|
||||
# Some systems have setpshared and define PROCESS_SHARED, but don't
|
||||
# really support PROCESS_SHARED locks. So, we must validate that we
|
||||
# can go through the steps without receiving some sort of system error.
|
||||
@ -2289,8 +2335,8 @@ fi
|
||||
APR_IFALLYES(header:semaphore.h func:sem_open func:sem_close dnl
|
||||
func:sem_unlink func:sem_post func:sem_wait,
|
||||
hasposixser="1", hasposixser="0")
|
||||
APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, hassysvser="1",
|
||||
hassysvser="0")
|
||||
APR_IFALLYES(func:semget func:semctl func:semop define:SEM_UNDO,
|
||||
hassysvser="1", hassysvser="0")
|
||||
APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1", hasflockser="0")
|
||||
APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1", hasfcntlser="0")
|
||||
# note: the current APR use of shared mutex requires /dev/zero
|
||||
@ -2300,6 +2346,11 @@ APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl
|
||||
hasprocpthreadser="1", hasprocpthreadser="0")
|
||||
APR_IFALLYES(header:OS.h func:create_sem, hasbeossem="1", hasbeossem="0")
|
||||
|
||||
AC_CHECK_FUNCS(pthread_condattr_setpshared)
|
||||
APR_IFALLYES(header:pthread.h func:pthread_condattr_setpshared,
|
||||
have_pthread_condattr_setpshared="1", have_pthread_condattr_setpshared="0")
|
||||
AC_SUBST(have_pthread_condattr_setpshared)
|
||||
|
||||
# See which lock mechanism we'll select by default on this system.
|
||||
# The last APR_DECIDE to execute sets the default.
|
||||
# At this stage, we match the ordering in Apache 1.3
|
||||
@ -2315,10 +2366,18 @@ APR_IFALLYES(func:flock define:LOCK_EX,
|
||||
APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()]))
|
||||
APR_IFALLYES(header:fcntl.h define:F_SETLK,
|
||||
APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()]))
|
||||
APR_IFALLYES(func:semget func:semctl define:SEM_UNDO,
|
||||
APR_IFALLYES(func:semget func:semctl func:semop define:SEM_UNDO,
|
||||
APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()]))
|
||||
APR_IFALLYES(header:OS.h func:create_sem,
|
||||
APR_IFALLYES(header:OS.h func:create_sem func:acquire_sem func:acquire_sem_etc,
|
||||
APR_DECIDE(USE_BEOSSEM, [BeOS Semaphores]))
|
||||
# pthread mutex both pshared and robust[_np] is the best default
|
||||
case "$apr_cv_mutex_robust_shared" in
|
||||
"yes"|"np")
|
||||
APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread pshared mutex])
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
if test "x$apr_lock_method" != "x"; then
|
||||
APR_DECISION_FORCE($apr_lock_method)
|
||||
fi
|
||||
@ -2478,6 +2537,15 @@ else
|
||||
fi
|
||||
|
||||
dnl ----------------------------- Checking for /dev/random
|
||||
AC_CHECK_HEADERS(sys/random.h)
|
||||
AC_CHECK_FUNCS(getrandom)
|
||||
|
||||
AC_CHECK_HEADERS(sys/syscall.h)
|
||||
AC_CHECK_HEADERS(linux/random.h)
|
||||
AC_CHECK_DECLS([SYS_getrandom], [], [], [#include <sys/syscall.h>])
|
||||
|
||||
AC_CHECK_FUNCS(arc4random_buf)
|
||||
|
||||
AC_MSG_CHECKING(for entropy source)
|
||||
|
||||
why_no_rand=""
|
||||
@ -2495,10 +2563,27 @@ AC_ARG_WITH(egd,
|
||||
rand="1"
|
||||
])
|
||||
|
||||
if test "$rand" != "1"; then
|
||||
if test "$ac_cv_func_getrandom" = yes; then
|
||||
rand="getrandom"
|
||||
elif test "$ac_cv_have_decl_SYS_getrandom" = yes; then
|
||||
rand="SYS_getrandom"
|
||||
elif test "$ac_cv_func_arc4random_buf" = yes; then
|
||||
rand="arc4random"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$rand" != "1"; then
|
||||
AC_ARG_WITH(devrandom,
|
||||
[ --with-devrandom[[=DEV]] use /dev/random or compatible [[searches by default]]],
|
||||
[ apr_devrandom="$withval" ], [ apr_devrandom="yes" ])
|
||||
[ apr_devrandom="$withval" ], [ apr_devrandom="no" ])
|
||||
if test "$apr_devrandom" = "no"; then
|
||||
if test -z "$rand"; then
|
||||
apr_devrandom="yes"
|
||||
else
|
||||
apr_devrandom="no"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$apr_devrandom" = "yes"; then
|
||||
# /dev/random on OpenBSD doesn't provide random data, so
|
||||
@ -2506,7 +2591,7 @@ if test "$rand" != "1"; then
|
||||
for f in /dev/arandom /dev/urandom /dev/random; do
|
||||
if test -r $f; then
|
||||
apr_devrandom=$f
|
||||
rand=1
|
||||
rand="1"
|
||||
break
|
||||
fi
|
||||
done
|
||||
@ -2532,6 +2617,10 @@ if test "$rand" != "1"; then
|
||||
if test "$rand" = "1"; then
|
||||
AC_DEFINE_UNQUOTED(DEV_RANDOM, ["$apr_devrandom"], [Define to path of random device])
|
||||
AC_MSG_RESULT([$apr_devrandom])
|
||||
elif test -n "$rand"; then
|
||||
AC_DEFINE_UNQUOTED(SYS_RANDOM, ["$rand"], [Define system call of random])
|
||||
AC_MSG_RESULT([$rand])
|
||||
rand="1"
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -2749,7 +2838,7 @@ esac
|
||||
AC_SEARCH_LIBS(getaddrinfo, socket inet6)
|
||||
AC_SEARCH_LIBS(gai_strerror, socket inet6)
|
||||
AC_SEARCH_LIBS(getnameinfo, socket inet6)
|
||||
AC_CHECK_FUNCS(gai_strerror)
|
||||
AC_CHECK_FUNCS(gai_strerror if_nametoindex if_indextoname)
|
||||
APR_CHECK_WORKING_GETADDRINFO
|
||||
APR_CHECK_NEGATIVE_EAI
|
||||
APR_CHECK_WORKING_GETNAMEINFO
|
||||
@ -2787,6 +2876,12 @@ AC_MSG_RESULT($ipv6_result)
|
||||
|
||||
AC_SUBST(have_ipv6)
|
||||
|
||||
AC_ARG_ENABLE(timedlocks,
|
||||
[ --disable-timedlocks Disable timed locks ],
|
||||
[apr_has_timedlocks="0"], [apr_has_timedlocks="1"]
|
||||
)
|
||||
AC_SUBST(apr_has_timedlocks)
|
||||
|
||||
# hstrerror is only needed if IPv6 is not enabled,
|
||||
# so getaddrinfo/gai_strerror are not used.
|
||||
if test $have_ipv6 = 0; then
|
||||
|
1419
encoding/apr_encode.c
Normal file
1419
encoding/apr_encode.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -27,50 +27,10 @@
|
||||
|
||||
#include "apr_escape.h"
|
||||
#include "apr_escape_test_char.h"
|
||||
#include "apr_encode_private.h"
|
||||
#include "apr_lib.h"
|
||||
#include "apr_strings.h"
|
||||
|
||||
#if APR_CHARSET_EBCDIC
|
||||
static int convert_a2e[256] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F,
|
||||
0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61,
|
||||
0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F,
|
||||
0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6,
|
||||
0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D,
|
||||
0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
|
||||
0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x06, 0x17, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x09, 0x0A, 0x1B,
|
||||
0x30, 0x31, 0x1A, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3A, 0x3B, 0x04, 0x14, 0x3E, 0xFF,
|
||||
0x41, 0xAA, 0x4A, 0xB1, 0x9F, 0xB2, 0x6A, 0xB5, 0xBB, 0xB4, 0x9A, 0x8A, 0xB0, 0xCA, 0xAF, 0xBC,
|
||||
0x90, 0x8F, 0xEA, 0xFA, 0xBE, 0xA0, 0xB6, 0xB3, 0x9D, 0xDA, 0x9B, 0x8B, 0xB7, 0xB8, 0xB9, 0xAB,
|
||||
0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9E, 0x68, 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77,
|
||||
0xAC, 0x69, 0xED, 0xEE, 0xEB, 0xEF, 0xEC, 0xBF, 0x80, 0xFD, 0xFE, 0xFB, 0xFC, 0xBA, 0xAE, 0x59,
|
||||
0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9C, 0x48, 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57,
|
||||
0x8C, 0x49, 0xCD, 0xCE, 0xCB, 0xCF, 0xCC, 0xE1, 0x70, 0xDD, 0xDE, 0xDB, 0xDC, 0x8D, 0x8E, 0xDF };
|
||||
|
||||
static int convert_e2a[256] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x10, 0x11, 0x12, 0x13, 0x9D, 0x0A, 0x08, 0x87, 0x18, 0x19, 0x92, 0x8F, 0x1C, 0x1D, 0x1E, 0x1F,
|
||||
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x17, 0x1B, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x05, 0x06, 0x07,
|
||||
0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, 0x98, 0x99, 0x9A, 0x9B, 0x14, 0x15, 0x9E, 0x1A,
|
||||
0x20, 0xA0, 0xE2, 0xE4, 0xE0, 0xE1, 0xE3, 0xE5, 0xE7, 0xF1, 0xA2, 0x2E, 0x3C, 0x28, 0x2B, 0x7C,
|
||||
0x26, 0xE9, 0xEA, 0xEB, 0xE8, 0xED, 0xEE, 0xEF, 0xEC, 0xDF, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0x5E,
|
||||
0x2D, 0x2F, 0xC2, 0xC4, 0xC0, 0xC1, 0xC3, 0xC5, 0xC7, 0xD1, 0xA6, 0x2C, 0x25, 0x5F, 0x3E, 0x3F,
|
||||
0xF8, 0xC9, 0xCA, 0xCB, 0xC8, 0xCD, 0xCE, 0xCF, 0xCC, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22,
|
||||
0xD8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0xAB, 0xBB, 0xF0, 0xFD, 0xFE, 0xB1,
|
||||
0xB0, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0xAA, 0xBA, 0xE6, 0xB8, 0xC6, 0xA4,
|
||||
0xB5, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0xA1, 0xBF, 0xD0, 0x5B, 0xDE, 0xAE,
|
||||
0xAC, 0xA3, 0xA5, 0xB7, 0xA9, 0xA7, 0xB6, 0xBC, 0xBD, 0xBE, 0xDD, 0xA8, 0xAF, 0x5D, 0xB4, 0xD7,
|
||||
0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0xAD, 0xF4, 0xF6, 0xF2, 0xF3, 0xF5,
|
||||
0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0xB9, 0xFB, 0xFC, 0xF9, 0xFA, 0xFF,
|
||||
0x5C, 0xF7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0xB2, 0xD4, 0xD6, 0xD2, 0xD3, 0xD5,
|
||||
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0xB3, 0xDB, 0xDC, 0xD9, 0xDA, 0x9F };
|
||||
#define RAW_ASCII_CHAR(ch) convert_e2a[(unsigned char)ch]
|
||||
#else /* APR_CHARSET_EBCDIC */
|
||||
#define RAW_ASCII_CHAR(ch) (ch)
|
||||
#endif /* !APR_CHARSET_EBCDIC */
|
||||
|
||||
/* we assume the folks using this ensure 0 <= c < 256... which means
|
||||
* you need a cast to (unsigned char) first, you can't just plug a
|
||||
* char in here and get it to work, because if char is signed then it
|
||||
@ -171,7 +131,7 @@ static char x2c(const char *what)
|
||||
xstr[2]=what[0];
|
||||
xstr[3]=what[1];
|
||||
xstr[4]='\0';
|
||||
digit = convert_a2e[0xFF & strtol(xstr, NULL, 16)];
|
||||
digit = ENCODE_TO_NATIVE[0xFF & strtol(xstr, NULL, 16)];
|
||||
#endif /*APR_CHARSET_EBCDIC*/
|
||||
return (digit);
|
||||
}
|
||||
@ -756,7 +716,7 @@ APR_DECLARE(apr_status_t) apr_unescape_entity(char *unescaped, const char *str,
|
||||
size--;
|
||||
}
|
||||
else {
|
||||
*d = RAW_ASCII_CHAR(val);
|
||||
*d = ENCODE_TO_ASCII(val);
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
@ -777,7 +737,7 @@ APR_DECLARE(apr_status_t) apr_unescape_entity(char *unescaped, const char *str,
|
||||
*d = '&'; /* unknown */
|
||||
}
|
||||
else {
|
||||
*d = RAW_ASCII_CHAR(((const unsigned char *) ents)[j]);
|
||||
*d = ENCODE_TO_ASCII(((const unsigned char *) ents)[j]);
|
||||
s += i;
|
||||
slen -= i;
|
||||
found = 1;
|
||||
|
@ -24,6 +24,10 @@
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#ifndef NAME_MAX
|
||||
#define NAME_MAX 255
|
||||
#endif
|
||||
|
||||
static apr_status_t dir_cleanup(void *thedir)
|
||||
{
|
||||
apr_dir_t *dir = thedir;
|
||||
@ -71,14 +75,6 @@ static char *path_remove_last_component (const char *path, apr_pool_t *pool)
|
||||
apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname,
|
||||
apr_pool_t *pool)
|
||||
{
|
||||
/* On some platforms (e.g., Linux+GNU libc), d_name[] in struct
|
||||
* dirent is declared with enough storage for the name. On other
|
||||
* platforms (e.g., Solaris 8 for Intel), d_name is declared as a
|
||||
* one-byte array. Note: gcc evaluates this at compile time.
|
||||
*/
|
||||
apr_size_t dirent_size =
|
||||
sizeof(*(*new)->entry) +
|
||||
(sizeof((*new)->entry->d_name) > 1 ? 0 : 255);
|
||||
DIR *dir = opendir(dirname);
|
||||
|
||||
if (!dir) {
|
||||
@ -90,7 +86,20 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname,
|
||||
(*new)->pool = pool;
|
||||
(*new)->dirname = apr_pstrdup(pool, dirname);
|
||||
(*new)->dirstruct = dir;
|
||||
(*new)->entry = apr_pcalloc(pool, dirent_size);
|
||||
|
||||
#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
|
||||
&& !defined(READDIR_IS_THREAD_SAFE)
|
||||
/* On some platforms (e.g., Linux+GNU libc), d_name[] in struct
|
||||
* dirent is declared with enough storage for the name. On other
|
||||
* platforms (e.g., Solaris 8 for Intel), d_name is declared as a
|
||||
* one-byte array. Note: gcc evaluates this at compile time.
|
||||
*/
|
||||
(*new)->entry = apr_pcalloc(pool, sizeof(*(*new)->entry) +
|
||||
(sizeof((*new)->entry->d_name) > 1
|
||||
? 0 : NAME_MAX));
|
||||
#else
|
||||
(*new)->entry = NULL;
|
||||
#endif
|
||||
|
||||
apr_pool_cleanup_register((*new)->pool, *new, dir_cleanup,
|
||||
apr_pool_cleanup_null);
|
||||
|
@ -93,6 +93,7 @@
|
||||
#define APR_HAVE_STDLIB_H @stdlibh@
|
||||
#define APR_HAVE_STRING_H @stringh@
|
||||
#define APR_HAVE_STRINGS_H @stringsh@
|
||||
#define APR_HAVE_INTTYPES_H @inttypesh@
|
||||
#define APR_HAVE_SYS_IOCTL_H @sys_ioctlh@
|
||||
#define APR_HAVE_SYS_SENDFILE_H @sys_sendfileh@
|
||||
#define APR_HAVE_SYS_SIGNAL_H @sys_signalh@
|
||||
@ -168,16 +169,25 @@
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS)
|
||||
#if APR_HAVE_STDINT_H
|
||||
#ifdef __cplusplus
|
||||
/* C99 7.18.4 requires that stdint.h only exposes INT64_C
|
||||
* and UINT64_C for C++ implementations if this is defined: */
|
||||
#ifndef __STDC_CONSTANT_MACROS
|
||||
#define __STDC_CONSTANT_MACROS
|
||||
#endif
|
||||
|
||||
#if APR_HAVE_STDINT_H
|
||||
/* C++ needs this too for PRI*NN formats: */
|
||||
#ifndef __STDC_FORMAT_MACROS
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#if APR_HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#if APR_HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
@ -197,6 +207,13 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* __APPLE__ is now the official pre-defined macro for macOS */
|
||||
#ifdef __APPLE__
|
||||
#undef DARWIN
|
||||
#undef DARWIN_10
|
||||
#define DARWIN
|
||||
#define DARWIN_10
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -280,6 +297,7 @@ extern "C" {
|
||||
#define APR_HAS_LARGE_FILES @aprlfs@
|
||||
#define APR_HAS_XTHREAD_FILES @apr_has_xthread_files@
|
||||
#define APR_HAS_OS_UUID @osuuid@
|
||||
#define APR_HAS_TIMEDLOCKS @apr_has_timedlocks@
|
||||
|
||||
#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD @apr_procattr_user_set_requires_password@
|
||||
|
||||
@ -334,24 +352,28 @@ typedef unsigned @int_value@ apr_uint32_t;
|
||||
*/
|
||||
#ifdef DARWIN_10
|
||||
#undef APR_SIZEOF_VOIDP
|
||||
#undef INT64_C
|
||||
#undef UINT64_C
|
||||
#undef APR_INT64_C
|
||||
#undef APR_UINT64_C
|
||||
#ifdef __LP64__
|
||||
typedef long apr_int64_t;
|
||||
typedef unsigned long apr_uint64_t;
|
||||
#define APR_SIZEOF_VOIDP 8
|
||||
#define INT64_C(v) (v ## L)
|
||||
#define UINT64_C(v) (v ## UL)
|
||||
#define APR_INT64_C(v) (v ## L)
|
||||
#define APR_UINT64_C(v) (v ## UL)
|
||||
#else
|
||||
typedef long long apr_int64_t;
|
||||
typedef unsigned long long apr_uint64_t;
|
||||
#define APR_SIZEOF_VOIDP 4
|
||||
#define INT64_C(v) (v ## LL)
|
||||
#define UINT64_C(v) (v ## ULL)
|
||||
#define APR_INT64_C(v) (v ## LL)
|
||||
#define APR_UINT64_C(v) (v ## ULL)
|
||||
#endif
|
||||
#else
|
||||
typedef @long_value@ apr_int64_t;
|
||||
typedef unsigned @long_value@ apr_uint64_t;
|
||||
typedef @int64_value@ apr_int64_t;
|
||||
typedef @uint64_value@ apr_uint64_t;
|
||||
|
||||
/* Mechanisms to properly type numeric literals */
|
||||
@int64_literal@
|
||||
@uint64_literal@
|
||||
#endif
|
||||
|
||||
typedef @size_t_value@ apr_size_t;
|
||||
@ -369,10 +391,6 @@ typedef apr_uint32_t apr_uintptr_t;
|
||||
/* Are we big endian? */
|
||||
#define APR_IS_BIGENDIAN @bigendian@
|
||||
|
||||
/* Mechanisms to properly type numeric literals */
|
||||
@int64_literal@
|
||||
@uint64_literal@
|
||||
|
||||
#ifdef INT16_MIN
|
||||
#define APR_INT16_MIN INT16_MIN
|
||||
#else
|
||||
|
@ -214,6 +214,7 @@ extern "C" {
|
||||
#define APR_HAS_LARGE_FILES 1
|
||||
#define APR_HAS_XTHREAD_FILES 0
|
||||
#define APR_HAS_OS_UUID 0
|
||||
#define APR_HAS_TIMEDLOCKS 1
|
||||
|
||||
#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD 0
|
||||
|
||||
|
@ -339,6 +339,7 @@ extern "C" {
|
||||
#define APR_HAS_UNICODE_FS 1
|
||||
#define APR_HAS_PROC_INVOKED 1
|
||||
#define APR_HAS_OS_UUID 1
|
||||
#define APR_HAS_TIMEDLOCKS 1
|
||||
|
||||
#ifndef _WIN32_WCE
|
||||
#define APR_HAS_SENDFILE 1
|
||||
|
@ -336,6 +336,7 @@ extern "C" {
|
||||
#define APR_HAS_UNICODE_FS 1
|
||||
#define APR_HAS_PROC_INVOKED 1
|
||||
#define APR_HAS_OS_UUID 1
|
||||
#define APR_HAS_TIMEDLOCKS 1
|
||||
|
||||
#ifndef _WIN32_WCE
|
||||
#define APR_HAS_SENDFILE 1
|
||||
|
@ -113,6 +113,73 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint3
|
||||
*/
|
||||
APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val);
|
||||
|
||||
/*
|
||||
* Atomic operations on 64-bit values
|
||||
* Note: Each of these functions internally implements a memory barrier
|
||||
* on platforms that require it
|
||||
*/
|
||||
|
||||
/**
|
||||
* atomically read an apr_uint64_t from memory
|
||||
* @param mem the pointer
|
||||
*/
|
||||
APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem);
|
||||
|
||||
/**
|
||||
* atomically set an apr_uint64_t in memory
|
||||
* @param mem pointer to the object
|
||||
* @param val value that the object will assume
|
||||
*/
|
||||
APR_DECLARE(void) apr_atomic_set64(volatile apr_uint64_t *mem, apr_uint64_t val);
|
||||
|
||||
/**
|
||||
* atomically add 'val' to an apr_uint64_t
|
||||
* @param mem pointer to the object
|
||||
* @param val amount to add
|
||||
* @return old value pointed to by mem
|
||||
*/
|
||||
APR_DECLARE(apr_uint64_t) apr_atomic_add64(volatile apr_uint64_t *mem, apr_uint64_t val);
|
||||
|
||||
/**
|
||||
* atomically subtract 'val' from an apr_uint64_t
|
||||
* @param mem pointer to the object
|
||||
* @param val amount to subtract
|
||||
*/
|
||||
APR_DECLARE(void) apr_atomic_sub64(volatile apr_uint64_t *mem, apr_uint64_t val);
|
||||
|
||||
/**
|
||||
* atomically increment an apr_uint64_t by 1
|
||||
* @param mem pointer to the object
|
||||
* @return old value pointed to by mem
|
||||
*/
|
||||
APR_DECLARE(apr_uint64_t) apr_atomic_inc64(volatile apr_uint64_t *mem);
|
||||
|
||||
/**
|
||||
* atomically decrement an apr_uint64_t by 1
|
||||
* @param mem pointer to the atomic value
|
||||
* @return zero if the value becomes zero on decrement, otherwise non-zero
|
||||
*/
|
||||
APR_DECLARE(int) apr_atomic_dec64(volatile apr_uint64_t *mem);
|
||||
|
||||
/**
|
||||
* compare an apr_uint64_t's value with 'cmp'.
|
||||
* If they are the same swap the value with 'with'
|
||||
* @param mem pointer to the value
|
||||
* @param with what to swap it with
|
||||
* @param cmp the value to compare it to
|
||||
* @return the old value of *mem
|
||||
*/
|
||||
APR_DECLARE(apr_uint64_t) apr_atomic_cas64(volatile apr_uint64_t *mem, apr_uint64_t with,
|
||||
apr_uint64_t cmp);
|
||||
|
||||
/**
|
||||
* exchange an apr_uint64_t's value with 'val'.
|
||||
* @param mem pointer to the value
|
||||
* @param val what to swap it with
|
||||
* @return the old value of *mem
|
||||
*/
|
||||
APR_DECLARE(apr_uint64_t) apr_atomic_xchg64(volatile apr_uint64_t *mem, apr_uint64_t val);
|
||||
|
||||
/**
|
||||
* compare the pointer's value with cmp.
|
||||
* If they are the same swap the value with 'with'
|
||||
|
569
include/apr_encode.h
Normal file
569
include/apr_encode.h
Normal file
@ -0,0 +1,569 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file apr_encode.h
|
||||
* @brief APR-UTIL Encoding
|
||||
*/
|
||||
#ifndef APR_ENCODE_H
|
||||
#define APR_ENCODE_H
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_general.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup APR_Util_Encode Base64/Base64Url/Base32/Base32Hex/Base16 Encoding
|
||||
* @ingroup APR_Util
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* RFC4648 and RFC7515 compliant BASE64, BASE64URL, BASE32, BASE32HEX
|
||||
* and BASE16 encode/decode functions.
|
||||
*
|
||||
* The following encodings are supported:
|
||||
*
|
||||
* - Base 64 Encoding
|
||||
*
|
||||
* o Use flag APR_ENCODE_NONE
|
||||
* o https://tools.ietf.org/html/rfc4648#section-4
|
||||
*
|
||||
* - Base 64 Encoding with URL and Filename Safe Alphabet
|
||||
*
|
||||
* o Use flag APR_ENCODE_URL
|
||||
* o https://tools.ietf.org/html/rfc4648#section-5
|
||||
*
|
||||
* - Base 64 URL Encoding without Padding
|
||||
*
|
||||
* o Use flag APR_ENCODE_BASE64URL
|
||||
* o https://tools.ietf.org/html/rfc7515#appendix-C
|
||||
*
|
||||
* - Base 32 Encoding
|
||||
*
|
||||
* o Use flag APR_ENCODE_NONE
|
||||
* o https://tools.ietf.org/html/rfc4648#section-6
|
||||
*
|
||||
* - Base 32 Encoding with Extended Hex Alphabet
|
||||
*
|
||||
* o Use flag APR_ENCODE_BASE32HEX
|
||||
* o https://tools.ietf.org/html/rfc4648#section-7
|
||||
*
|
||||
* - Base 16 Encoding
|
||||
*
|
||||
* o Use flags APR_ENCODE_NONE/APR_ENCODE_COLON
|
||||
* o https://tools.ietf.org/html/rfc4648#section-8
|
||||
*
|
||||
* If a non valid character of any kind including whitespace is passed to any
|
||||
* of the decoder functions, APR_BADCH will be returned. In this case decoding
|
||||
* will still take place, but the results can not be trusted.
|
||||
*
|
||||
* If APR_ENCODE_RELAXED is passed to the decoder functions, decoding will be
|
||||
* attempted up until the first non valid character. If this results in an
|
||||
* invalid state in the decoder, such as but not limited to an odd number of
|
||||
* base16 characters, APR_BADCH will still be returned.
|
||||
*
|
||||
* If APR_ENCODE_RELAXED is not passed to a decoder function, the decoding will
|
||||
* be done in constant time regardless of whether the result returns APR_SUCCESS
|
||||
* or APR_BADCH.
|
||||
*
|
||||
* If the dest parameter is NULL, the maximum theoretical buffer size is
|
||||
* returned in the len field, including space for a terminating zero character
|
||||
* if the destination is a string. This value can be used to allocate buffers
|
||||
* of a suitable safe size.
|
||||
*
|
||||
* If the dest parameter is provided, the encoding or decoding will take place,
|
||||
* and the actual number of characters written is returned in the len field,
|
||||
* ignoring any terminating zero.
|
||||
*
|
||||
* Plain strings are not assumed '\0' terminated unless APR_ENCODE_STRING is
|
||||
* provided.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* When passing a string to one of the encode functions, this value can be
|
||||
* passed to indicate a string-valued key, and have the length computed
|
||||
* automatically.
|
||||
*/
|
||||
#define APR_ENCODE_STRING (-1)
|
||||
|
||||
/**
|
||||
* Generate RFC4648 base16/base32/base64.
|
||||
*/
|
||||
#define APR_ENCODE_NONE 0
|
||||
|
||||
/**
|
||||
* If relaxed, decode up until the first non base16/base32/base64 character.
|
||||
*/
|
||||
#define APR_ENCODE_RELAXED 1
|
||||
|
||||
/**
|
||||
* Omit the padding character (=) while encoding.
|
||||
*/
|
||||
#define APR_ENCODE_NOPADDING 2
|
||||
|
||||
/**
|
||||
* Generate RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet
|
||||
*/
|
||||
#define APR_ENCODE_URL 4
|
||||
|
||||
/**
|
||||
* Generate RFC7515 BASE64URL
|
||||
*/
|
||||
#define APR_ENCODE_BASE64URL (APR_ENCODE_NOPADDING | APR_ENCODE_URL)
|
||||
|
||||
/**
|
||||
* Generate base32hex encoding instead of base32 encoding
|
||||
*/
|
||||
#define APR_ENCODE_BASE32HEX 8
|
||||
|
||||
/**
|
||||
* Generate base16 with colons between each token.
|
||||
*/
|
||||
#define APR_ENCODE_COLON 16
|
||||
|
||||
/**
|
||||
* Generate base16 with lower case characters.
|
||||
*/
|
||||
#define APR_ENCODE_LOWER 32
|
||||
|
||||
/**
|
||||
* Convert text data to base64.
|
||||
* @param dest The destination string, can be NULL.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, emit RFC4648 Base 64 Encoding. If
|
||||
* APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_URL,
|
||||
* use RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet.
|
||||
* If APR_ENCODE_BASE64URL, use RFC7515 base64url Encoding.
|
||||
* @param len If present and src is NULL, returns the maximum possible length
|
||||
* of the destination string, including a zero pad. If present and src is
|
||||
* not NULL, returns the number of characters actually written.
|
||||
* @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_encode_base64(char *dest, const char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len);
|
||||
|
||||
/**
|
||||
* Convert binary data to base64.
|
||||
* @param dest The destination string, can be NULL.
|
||||
* @param src The original buffer.
|
||||
* @param slen The length of the original buffer.
|
||||
* @param flags If APR_ENCODE_NONE, emit RFC4648 Base 64 Encoding. If
|
||||
* APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_URL,
|
||||
* use RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet.
|
||||
* If APR_ENCODE_BASE64URL, use RFC7515 base64url Encoding.
|
||||
* @param len If present and src is NULL, returns the maximum possible length
|
||||
* of the destination string, including a zero pad. If present and src is
|
||||
* not NULL, returns the number of characters actually written.
|
||||
* @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_encode_base64_binary(char *dest, const unsigned char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len);
|
||||
|
||||
/**
|
||||
* Convert text data to base64, and return the results from a pool.
|
||||
* @param p Pool to allocate from.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, emit RFC4648 Base 64 Encoding. If
|
||||
* APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_URL,
|
||||
* use RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet.
|
||||
* If APR_ENCODE_BASE64URL, use RFC7515 base64url Encoding.
|
||||
* @param len If present, returns the number of characters written excluding
|
||||
* the zero pad.
|
||||
* @return A zero padded string allocated from the pool on success, or
|
||||
* NULL if src was NULL.
|
||||
*/
|
||||
APR_DECLARE(const char *)apr_pencode_base64(apr_pool_t * p, const char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len)__attribute__((nonnull(1)));
|
||||
|
||||
/**
|
||||
* Convert binary data to base64, and return the results from a pool.
|
||||
* @param p Pool to allocate from.
|
||||
* @param src The original buffer.
|
||||
* @param slen The length of the original buffer.
|
||||
* @param flags If APR_ENCODE_NONE, emit RFC4648 Base 64 Encoding. If
|
||||
* APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_URL,
|
||||
* use RFC4648 Base 64 Encoding with URL and Filename Safe Alphabet.
|
||||
* If APR_ENCODE_BASE64URL, use RFC7515 base64url Encoding.
|
||||
* @param len If present, returns the number of characters written excluding
|
||||
* the zero pad.
|
||||
* @return A zero padded string allocated from the pool on success, or
|
||||
* NULL if src was NULL.
|
||||
*/
|
||||
APR_DECLARE(const char *)apr_pencode_base64_binary(apr_pool_t * p, const unsigned char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len)__attribute__((nonnull(1)));
|
||||
|
||||
/**
|
||||
* Convert base64 or base64url with or without padding to text data.
|
||||
* @param dest The destination string, can be NULL.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, attempt to decode the full original buffer,
|
||||
* and return NULL if any bad character is detected. If APR_ENCODE_RELAXED,
|
||||
* decode until the first non base64/base64url character.
|
||||
* @param len If present and src is NULL, returns the maximum possible length
|
||||
* of the destination string, including a zero pad. If present and src is
|
||||
* not NULL, returns the number of characters actually written.
|
||||
* @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH
|
||||
* if a non hex character is present.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_decode_base64(char *dest, const char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len);
|
||||
|
||||
/**
|
||||
* Convert base64 or base64url with or without padding to binary data.
|
||||
* @param dest The destination buffer, can be NULL.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, attempt to decode the full original buffer,
|
||||
* and return NULL if any bad character is detected. If APR_ENCODE_RELAXED,
|
||||
* decode until the first non base64/base64url character.
|
||||
* @param len If present and src is NULL, returns the maximum possible length
|
||||
* of the destination buffer, including a zero pad. If present and src is
|
||||
* not NULL, returns the number of characters actually written.
|
||||
* @return APR_SUCCESS, or APR_NOTFOUND if the src was NULL, or APR_BADCH
|
||||
* if a non base64 character is present.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_decode_base64_binary(unsigned char *dest,
|
||||
const char *src, apr_ssize_t slen, int flags, apr_size_t * len);
|
||||
|
||||
/**
|
||||
* Convert base64 or base64url with or without padding to text data, and
|
||||
* return the results from a pool.
|
||||
* @param p Pool to allocate from.
|
||||
* @param src The base64 string to decode.
|
||||
* @param slen The length of the base64 string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, attempt to decode the full original buffer,
|
||||
* and return NULL if any bad character is detected. If APR_ENCODE_RELAXED,
|
||||
* decode until the first non base64/base64url character.
|
||||
* @param len If present, returns the number of characters written, excluding
|
||||
* the zero padding.
|
||||
* @return A string allocated from the pool containing the result with a zero
|
||||
* pad. If src was NULL, or an error occurred, NULL is returned.
|
||||
*/
|
||||
APR_DECLARE(const char *)apr_pdecode_base64(apr_pool_t * p, const char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len)
|
||||
__attribute__((nonnull(1)));
|
||||
|
||||
/**
|
||||
* Convert base64 or base64url with or without padding to binary data, and
|
||||
* return the results from a pool.
|
||||
* @param p Pool to allocate from.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, attempt to decode the full original buffer,
|
||||
* and return NULL if any bad character is detected. If APR_ENCODE_RELAXED,
|
||||
* decode until the first non base64/base64url character.
|
||||
* @param len If present, returns the number of characters written, excluding
|
||||
* the zero padding.
|
||||
* @return A buffer allocated from the pool containing the result with a zero
|
||||
* pad. If src was NULL, or an error occurred, NULL is returned.
|
||||
*/
|
||||
APR_DECLARE(const unsigned char *)apr_pdecode_base64_binary(apr_pool_t * p,
|
||||
const char *src, apr_ssize_t slen, int flags, apr_size_t * len)
|
||||
__attribute__((nonnull(1)));
|
||||
|
||||
/**
|
||||
* Convert text data to base32.
|
||||
* @param dest The destination string, can be NULL.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If
|
||||
* APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX,
|
||||
* use RFC4648 base32hex Encoding.
|
||||
* @param len If present and src is NULL, returns the maximum possible length
|
||||
* of the destination string, including a zero pad. If present and src is
|
||||
* not NULL, returns the number of characters actually written.
|
||||
* @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_encode_base32(char *dest, const char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len);
|
||||
|
||||
/**
|
||||
* Convert binary data to base32.
|
||||
* @param dest The destination string, can be NULL.
|
||||
* @param src The original buffer.
|
||||
* @param slen The length of the original buffer.
|
||||
* @param flags If APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If
|
||||
* APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX,
|
||||
* use RFC4648 base32hex Encoding.
|
||||
* @param len If present and src is NULL, returns the maximum possible length
|
||||
* of the destination string, including a zero pad. If present and src is
|
||||
* not NULL, returns the number of characters actually written.
|
||||
* @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_encode_base32_binary(char *dest, const unsigned char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len);
|
||||
|
||||
/**
|
||||
* Convert text data to base32, and return the results from a pool.
|
||||
* @param p Pool to allocate from.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If
|
||||
* APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX,
|
||||
* use RFC4648 base32hex Encoding.
|
||||
* @param len If present, returns the number of characters written excluding
|
||||
* the zero pad.
|
||||
* @return A zero padded string allocated from the pool on success, or
|
||||
* NULL if src was NULL.
|
||||
*/
|
||||
APR_DECLARE(const char *)apr_pencode_base32(apr_pool_t * p, const char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len)
|
||||
__attribute__((nonnull(1)));
|
||||
|
||||
/**
|
||||
* Convert binary data to base32, and return the results from a pool.
|
||||
* @param p Pool to allocate from.
|
||||
* @param src The original buffer.
|
||||
* @param slen The length of the original buffer.
|
||||
* @param flags If APR_ENCODE_NONE, emit RFC4648 Base 32 Encoding. If
|
||||
* APR_ENCODE_NOPADDING, omit the = padding character. If APR_ENCODE_BASE32HEX,
|
||||
* use RFC7515 base32hex Encoding.
|
||||
* @param len If present, returns the number of characters written excluding
|
||||
* the zero pad.
|
||||
* @return A zero padded string allocated from the pool on success, or
|
||||
* NULL if src was NULL.
|
||||
*/
|
||||
APR_DECLARE(const char *)apr_pencode_base32_binary(apr_pool_t * p, const unsigned char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len)
|
||||
__attribute__((nonnull(1)));
|
||||
|
||||
/**
|
||||
* Convert base32 or base32hex with or without padding to text data.
|
||||
* @param dest The destination string, can be NULL.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, parse RFC4648 Base 32 Encoding. If
|
||||
* APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding.
|
||||
* @param len If present and src is NULL, returns the maximum possible length
|
||||
* of the destination buffer, including a zero pad. If present and src is
|
||||
* not NULL, returns the number of characters actually written.
|
||||
* @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH
|
||||
* if a non base32 character is present.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_decode_base32(char *dest, const char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len);
|
||||
|
||||
/**
|
||||
* Convert base32 or base32hex with or without padding to binary data.
|
||||
* @param dest The destination buffer, can be NULL.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, parse RFC4648 Base 32 Encoding. If
|
||||
* APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding.
|
||||
* @param len If present and src is NULL, returns the maximum possible length
|
||||
* of the destination buffer, including a zero pad. If present and src is
|
||||
* not NULL, returns the number of characters actually written.
|
||||
* @return APR_SUCCESS, or APR_NOTFOUND if the src was NULL, or APR_BADCH
|
||||
* if a non base32 character is present.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_decode_base32_binary(unsigned char *dest,
|
||||
const char *src, apr_ssize_t slen, int flags, apr_size_t * len);
|
||||
|
||||
/**
|
||||
* Convert base32 or base32hex with or without padding to text data, and
|
||||
* return the results from a pool.
|
||||
* @param p Pool to allocate from.
|
||||
* @param src The base32 string to decode.
|
||||
* @param slen The length of the base32 string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, parse RFC4648 Base 32 Encoding. If
|
||||
* APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding.
|
||||
* @param len If present, returns the number of characters written, excluding
|
||||
* the zero padding.
|
||||
* @return A string allocated from the pool containing the result with a zero
|
||||
* pad. If src was NULL, or an error occurred, NULL is returned.
|
||||
*/
|
||||
APR_DECLARE(const char *)apr_pdecode_base32(apr_pool_t * p, const char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len)
|
||||
__attribute__((nonnull(1)));
|
||||
|
||||
/**
|
||||
* Convert base32 or base32hex with or without padding to binary data, and
|
||||
* return the results from a pool.
|
||||
* @param p Pool to allocate from.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, parse RFC4648 Base 32 Encoding. If
|
||||
* APR_ENCODE_BASE32HEX, use RFC4648 base32hex Encoding.
|
||||
* @param len If present, returns the number of characters written, excluding
|
||||
* the zero padding.
|
||||
* @return A buffer allocated from the pool containing the result with a zero
|
||||
* pad. If src was NULL, or an error occurred, NULL is returned.
|
||||
*/
|
||||
APR_DECLARE(const unsigned char *)apr_pdecode_base32_binary(apr_pool_t * p,
|
||||
const char *src, apr_ssize_t slen, int flags, apr_size_t * len)
|
||||
__attribute__((nonnull(1)));
|
||||
|
||||
/**
|
||||
* Convert text data to base16 (hex).
|
||||
* @param dest The destination string, can be NULL.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If
|
||||
* APR_ENCODE_COLON, separate each token with a colon.
|
||||
* @param len If present and src is NULL, returns the maximum possible length
|
||||
* of the destination buffer, including a zero pad. If present and src is
|
||||
* not NULL, returns the number of characters actually written.
|
||||
* @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_encode_base16(char *dest, const char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len);
|
||||
|
||||
/**
|
||||
* Convert binary data to base16 (hex).
|
||||
* @param dest The destination string, can be NULL.
|
||||
* @param src The original buffer.
|
||||
* @param slen The length of the original buffer.
|
||||
* @param flags If APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If
|
||||
* APR_ENCODE_COLON, separate each token with a colon.
|
||||
* @param len If present and src is NULL, returns the maximum possible length
|
||||
* of the destination buffer, including a zero pad. If present and src is
|
||||
* not NULL, returns the number of characters actually written.
|
||||
* @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_encode_base16_binary(char *dest,
|
||||
const unsigned char *src, apr_ssize_t slen, int flags,
|
||||
apr_size_t * len);
|
||||
|
||||
/**
|
||||
* Convert text data to base16 (hex), and return the results from a
|
||||
* pool.
|
||||
* @param p Pool to allocate from.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If
|
||||
* APR_ENCODE_COLON, separate each token with a colon.
|
||||
* @param len If present, returns the number of characters written, excluding
|
||||
* the zero padding.
|
||||
* @return A string allocated from the pool containing the result with a zero
|
||||
* pad. If src was NULL, or an error occurred, NULL is returned.
|
||||
*/
|
||||
APR_DECLARE(const char *)apr_pencode_base16(apr_pool_t * p, const char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len)
|
||||
__attribute__((nonnull(1)));
|
||||
|
||||
/**
|
||||
* Convert binary data to base16 (hex), and return the results from a
|
||||
* pool.
|
||||
* @param p Pool to allocate from.
|
||||
* @param src The original buffer.
|
||||
* @param slen The length of the original buffer.
|
||||
* @param flags If APR_ENCODE_NONE, emit RFC4648 Base 16 Encoding. If
|
||||
* APR_ENCODE_COLON, separate each token with a colon.
|
||||
* @param len If present, returns the number of characters written, excluding
|
||||
* the zero padding.
|
||||
* @return A string allocated from the pool containing the result with a zero
|
||||
* pad. If src was NULL, or an error occurred, NULL is returned.
|
||||
*/
|
||||
APR_DECLARE(const char *)apr_pencode_base16_binary(apr_pool_t * p,
|
||||
const unsigned char *src, apr_ssize_t slen,
|
||||
int flags, apr_size_t * len)__attribute__((nonnull(1)));
|
||||
|
||||
/**
|
||||
* Convert base16 (hex) to text data.
|
||||
* @param dest The destination string, can be NULL.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, parse RFC4648 Base 16 Encoding. If
|
||||
* APR_ENCODE_COLON, allow tokens to be separated with a colon.
|
||||
* @param len If present and src is NULL, returns the maximum possible length
|
||||
* of the destination buffer, including a zero pad. If present and src is
|
||||
* not NULL, returns the number of characters actually written.
|
||||
* @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH
|
||||
* if a non hex character is present. A zero pad is appended to the buffer.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_decode_base16(char *dest, const char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len);
|
||||
|
||||
/**
|
||||
* Convert base16 (hex) to binary data.
|
||||
* @param dest The destination buffer, can be NULL.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, parse RFC4648 Base 16 Encoding. If
|
||||
* APR_ENCODE_COLON, allow tokens to be separated with a colon.
|
||||
* @param len If present and src is NULL, returns the maximum possible length
|
||||
* of the destination buffer, including a zero pad. If present and src is
|
||||
* not NULL, returns the number of characters actually written.
|
||||
* @return APR_SUCCESS, or APR_NOTFOUND if the string was NULL, or APR_BADCH
|
||||
* if a non hex character is present. No zero pad is written to the buffer.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_decode_base16_binary(unsigned char *dest,
|
||||
const char *src, apr_ssize_t slen, int flags, apr_size_t * len);
|
||||
|
||||
/**
|
||||
* Convert base16 (hex) and return the results from a pool.
|
||||
* @param p Pool to allocate from.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, parse RFC4648 Base 16 Encoding. If
|
||||
* APR_ENCODE_COLON, allow tokens to be separated with a colon.
|
||||
* @param len If present, returns the number of characters written, excluding
|
||||
* the zero padding.
|
||||
* @return A buffer allocated from the pool containing the result with a zero
|
||||
* pad. If src was NULL, or an error occurred, NULL is returned.
|
||||
*/
|
||||
APR_DECLARE(const char *)apr_pdecode_base16(apr_pool_t * p, const char *src,
|
||||
apr_ssize_t slen, int flags, apr_size_t * len)
|
||||
__attribute__((nonnull(1)));
|
||||
|
||||
/**
|
||||
* Convert base16 (hex) to binary data, and return the results from a pool.
|
||||
* @param p Pool to allocate from.
|
||||
* @param src The original string.
|
||||
* @param slen The length of the original string, or APR_ENCODE_STRING if
|
||||
* NUL terminated.
|
||||
* @param flags If APR_ENCODE_NONE, parse RFC4648 Base 16 Encoding. If
|
||||
* APR_ENCODE_COLON, allow tokens to be separated with a colon.
|
||||
* @param len If present, returns the number of characters written, excluding
|
||||
* the zero padding.
|
||||
* @return A buffer allocated from the pool containing the result with a zero
|
||||
* pad. If src was NULL, or an error occurred, NULL is returned.
|
||||
*/
|
||||
APR_DECLARE(const unsigned char *)apr_pdecode_base16_binary(apr_pool_t * p,
|
||||
const char *src, apr_ssize_t slen, int flags, apr_size_t * len)
|
||||
__attribute__((nonnull(1)));
|
||||
|
||||
/** @} */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !APR_ENCODE_H */
|
@ -32,6 +32,19 @@ extern "C" {
|
||||
*/
|
||||
|
||||
/* Simple escape/unescape functions.
|
||||
*
|
||||
* The design goal of these functions are:
|
||||
*
|
||||
* - Avoid unnecessary work.
|
||||
*
|
||||
* In most cases the strings passed in do not need to be escaped at all. In
|
||||
* these cases the original string will be returned.
|
||||
*
|
||||
* - Lowest possible memory footprint.
|
||||
*
|
||||
* The amount of memory allocated for a given encoding is calculated based
|
||||
* on the exact amount of memory needed, and not the theoretical worst case
|
||||
* scenario.
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
#if APR_PROC_MUTEX_IS_GLOBAL
|
||||
#include "apr_proc_mutex.h"
|
||||
#endif
|
||||
#include "apr_time.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -66,6 +67,7 @@ typedef struct apr_global_mutex_t apr_global_mutex_t;
|
||||
* APR_LOCK_POSIXSEM
|
||||
* APR_LOCK_PROC_PTHREAD
|
||||
* APR_LOCK_DEFAULT pick the default mechanism for the platform
|
||||
* APR_LOCK_DEFAULT_TIMED pick the default timed mechanism
|
||||
* </PRE>
|
||||
* @param pool the pool from which to allocate the mutex.
|
||||
* @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports
|
||||
@ -108,6 +110,17 @@ APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex);
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex);
|
||||
|
||||
/**
|
||||
* Attempt to acquire the lock for the given mutex until timeout expires.
|
||||
* If the acquisition time outs, the call returns with APR_TIMEUP.
|
||||
* @param mutex the mutex on which to attempt the lock acquiring.
|
||||
* @param timeout the relative timeout (microseconds).
|
||||
* @note A negative or nul timeout means immediate attempt, returning
|
||||
* APR_TIMEUP without blocking if it the lock is already acquired.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex,
|
||||
apr_interval_time_t timeout);
|
||||
|
||||
/**
|
||||
* Release the lock for the given mutex.
|
||||
* @param mutex the mutex from which to release the lock.
|
||||
|
@ -441,6 +441,31 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_copy(apr_sockaddr_t **dst,
|
||||
const apr_sockaddr_t *src,
|
||||
apr_pool_t *p);
|
||||
|
||||
/* Set the zone of an IPv6 link-local address object.
|
||||
* @param sa Socket address object
|
||||
* @param zone_id Zone ID (textual "eth0" or numeric "3").
|
||||
* @return Returns APR_EBADIP for non-IPv6 socket or an IPv6 address
|
||||
* which isn't link-local.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_sockaddr_zone_set(apr_sockaddr_t *sa,
|
||||
const char *zone_id);
|
||||
|
||||
|
||||
/* Retrieve the zone of an IPv6 link-local address object.
|
||||
* @param sa Socket address object
|
||||
* @param name If non-NULL, set to the textual representation of the zone id
|
||||
* @param id If non-NULL, set to the integer zone id
|
||||
* @param p Pool from which *name is allocated if used.
|
||||
* @return Returns APR_EBADIP for non-IPv6 socket or socket without any zone id
|
||||
* set, or other error if the interface could not be mapped to a name.
|
||||
* @remark Both name and id may be NULL, neither are modified if
|
||||
* non-NULL in error cases.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_sockaddr_zone_get(const apr_sockaddr_t *sa,
|
||||
const char **name,
|
||||
apr_uint32_t *id,
|
||||
apr_pool_t *p);
|
||||
|
||||
/**
|
||||
* Look up the host name from an apr_sockaddr_t.
|
||||
* @param hostname The hostname.
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "apr_pools.h"
|
||||
#include "apr_errno.h"
|
||||
#include "apr_perms_set.h"
|
||||
#include "apr_time.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -48,7 +49,8 @@ typedef enum {
|
||||
APR_LOCK_SYSVSEM, /**< System V Semaphores */
|
||||
APR_LOCK_PROC_PTHREAD, /**< POSIX pthread process-based locking */
|
||||
APR_LOCK_POSIXSEM, /**< POSIX semaphore process-based locking */
|
||||
APR_LOCK_DEFAULT /**< Use the default process lock */
|
||||
APR_LOCK_DEFAULT, /**< Use the default process lock */
|
||||
APR_LOCK_DEFAULT_TIMED /**< Use the default process timed lock */
|
||||
} apr_lockmech_e;
|
||||
|
||||
/** Opaque structure representing a process mutex. */
|
||||
@ -113,6 +115,17 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_lock(apr_proc_mutex_t *mutex);
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex);
|
||||
|
||||
/**
|
||||
* Attempt to acquire the lock for the given mutex until timeout expires.
|
||||
* If the acquisition time outs, the call returns with APR_TIMEUP.
|
||||
* @param mutex the mutex on which to attempt the lock acquiring.
|
||||
* @param timeout the relative timeout (microseconds).
|
||||
* @note A negative or nul timeout means immediate attempt, returning
|
||||
* APR_TIMEUP without blocking if it the lock is already acquired.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex,
|
||||
apr_interval_time_t timeout);
|
||||
|
||||
/**
|
||||
* Release the lock for the given mutex.
|
||||
* @param mutex the mutex from which to release the lock.
|
||||
|
@ -43,9 +43,11 @@ typedef struct apr_thread_mutex_t apr_thread_mutex_t;
|
||||
#define APR_THREAD_MUTEX_DEFAULT 0x0 /**< platform-optimal lock behavior */
|
||||
#define APR_THREAD_MUTEX_NESTED 0x1 /**< enable nested (recursive) locks */
|
||||
#define APR_THREAD_MUTEX_UNNESTED 0x2 /**< disable nested locks */
|
||||
#define APR_THREAD_MUTEX_TIMED 0x4 /**< enable timed locks */
|
||||
|
||||
/* Delayed the include to avoid a circular reference */
|
||||
#include "apr_pools.h"
|
||||
#include "apr_time.h"
|
||||
|
||||
/**
|
||||
* Create and initialize a mutex that can be used to synchronize threads.
|
||||
@ -81,6 +83,17 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex);
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex);
|
||||
|
||||
/**
|
||||
* Attempt to acquire the lock for the given mutex until timeout expires.
|
||||
* If the acquisition time outs, the call returns with APR_TIMEUP.
|
||||
* @param mutex the mutex on which to attempt the lock acquiring.
|
||||
* @param timeout the relative timeout (microseconds).
|
||||
* @note A timeout negative or nul means immediate attempt, returning
|
||||
* APR_TIMEUP without blocking if it the lock is already acquired.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex,
|
||||
apr_interval_time_t timeout);
|
||||
|
||||
/**
|
||||
* Release the lock for the given mutex.
|
||||
* @param mutex the mutex from which to release the lock.
|
||||
|
@ -816,6 +816,13 @@ APR_DECLARE(apr_status_t) apr_setup_signal_thread(void);
|
||||
* functions should return 1 if the signal has been handled, 0 otherwise.
|
||||
* @param signal_handler The function to call when a signal is received
|
||||
* apr_status_t apr_signal_thread((int)(*signal_handler)(int signum))
|
||||
* @note Synchronous signals like SIGABRT/SIGSEGV/SIGBUS/... are ignored by
|
||||
* apr_signal_thread() and thus can't be waited by this function (they remain
|
||||
* handled by the operating system or its native signals interface).
|
||||
* @remark In APR version 1.6 and ealier, SIGUSR2 was part of these ignored
|
||||
* signals and thus was never passed in to the signal_handler. From APR 1.7
|
||||
* this is no more the case so SIGUSR2 can be handled in signal_handler and
|
||||
* acted upon like the other asynchronous signals.
|
||||
*/
|
||||
APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum));
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
||||
*/
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_pools.h"
|
||||
#include "apr_errno.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -120,6 +119,9 @@ struct apr_time_exp_t {
|
||||
apr_int32_t tm_gmtoff;
|
||||
};
|
||||
|
||||
/* Delayed the include to avoid a circular reference */
|
||||
#include "apr_pools.h"
|
||||
|
||||
/**
|
||||
* Convert an ansi time_t to an apr_time_t
|
||||
* @param result the resulting apr_time_t
|
||||
|
@ -38,7 +38,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#define APR_COPYRIGHT "Copyright (c) 2000-2018 The Apache Software " \
|
||||
#define APR_COPYRIGHT "Copyright (c) 2000-2019 The Apache Software " \
|
||||
"Foundation or its licensors, as applicable."
|
||||
|
||||
/* The numeric compile-time version constants. These constants are the
|
||||
@ -56,13 +56,13 @@
|
||||
* Minor API changes that do not cause binary compatibility problems.
|
||||
* Reset to 0 when upgrading APR_MAJOR_VERSION
|
||||
*/
|
||||
#define APR_MINOR_VERSION 6
|
||||
#define APR_MINOR_VERSION 7
|
||||
|
||||
/** patch level
|
||||
* The Patch Level never includes API changes, simply bug fixes.
|
||||
* Reset to 0 when upgrading APR_MINOR_VERSION
|
||||
*/
|
||||
#define APR_PATCH_VERSION 5
|
||||
#define APR_PATCH_VERSION 0
|
||||
|
||||
/**
|
||||
* The symbol APR_IS_DEV_VERSION is only defined for internal,
|
||||
|
@ -18,28 +18,36 @@
|
||||
#define ATOMIC_H
|
||||
|
||||
#include "apr.h"
|
||||
#include "apr_pools.h"
|
||||
#include "apr_private.h"
|
||||
#include "apr_atomic.h"
|
||||
#include "apr_thread_mutex.h"
|
||||
|
||||
#if defined(USE_ATOMICS_GENERIC)
|
||||
/* noop */
|
||||
#elif defined(__GNUC__) && defined(__STRICT_ANSI__)
|
||||
/* force use of generic atomics if building e.g. with -std=c89, which
|
||||
* doesn't allow inline asm */
|
||||
# define USE_ATOMICS_GENERIC
|
||||
#elif HAVE_ATOMIC_BUILTINS
|
||||
# define USE_ATOMICS_BUILTINS
|
||||
#elif defined(SOLARIS2) && SOLARIS2 >= 10
|
||||
# define USE_ATOMICS_SOLARIS
|
||||
# define NEED_ATOMICS_GENERIC64
|
||||
#elif defined(__GNUC__) && defined(__STRICT_ANSI__)
|
||||
/* force use of generic atomics if building e.g. with -std=c89, which
|
||||
* doesn't allow inline asm */
|
||||
# define USE_ATOMICS_GENERIC
|
||||
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
||||
# define USE_ATOMICS_IA32
|
||||
# define NEED_ATOMICS_GENERIC64
|
||||
#elif defined(__GNUC__) && (defined(__PPC__) || defined(__ppc__))
|
||||
# define USE_ATOMICS_PPC
|
||||
# define NEED_ATOMICS_GENERIC64
|
||||
#elif defined(__GNUC__) && (defined(__s390__) || defined(__s390x__))
|
||||
# define USE_ATOMICS_S390
|
||||
# define NEED_ATOMICS_GENERIC64
|
||||
#else
|
||||
# define USE_ATOMICS_GENERIC
|
||||
#endif
|
||||
|
||||
#if defined(USE_ATOMICS_GENERIC) || defined (NEED_ATOMICS_GENERIC64)
|
||||
apr_status_t apr__atomic_generic64_init(apr_pool_t *p);
|
||||
#endif
|
||||
|
||||
#endif /* ATOMIC_H */
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "apr_portable.h"
|
||||
#include "apr_file_io.h"
|
||||
#include "apr_arch_file_io.h"
|
||||
#include "apr_time.h"
|
||||
|
||||
/* System headers required by Locks library */
|
||||
#if APR_HAVE_SYS_TYPES_H
|
||||
@ -69,6 +70,7 @@ struct apr_proc_mutex_unix_lock_methods_t {
|
||||
apr_status_t (*create)(apr_proc_mutex_t *, const char *);
|
||||
apr_status_t (*acquire)(apr_proc_mutex_t *);
|
||||
apr_status_t (*tryacquire)(apr_proc_mutex_t *);
|
||||
apr_status_t (*timedacquire)(apr_proc_mutex_t *, apr_interval_time_t);
|
||||
apr_status_t (*release)(apr_proc_mutex_t *);
|
||||
apr_status_t (*cleanup)(void *);
|
||||
apr_status_t (*child_init)(apr_proc_mutex_t **, apr_pool_t *, const char *);
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "apr_private.h"
|
||||
#include "apr_general.h"
|
||||
#include "apr_thread_mutex.h"
|
||||
#include "apr_thread_cond.h"
|
||||
#include "apr_portable.h"
|
||||
#include "apr_atomic.h"
|
||||
|
||||
@ -32,6 +33,8 @@
|
||||
struct apr_thread_mutex_t {
|
||||
apr_pool_t *pool;
|
||||
pthread_mutex_t mutex;
|
||||
apr_thread_cond_t *cond;
|
||||
int locked, num_waiters;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -89,6 +89,12 @@
|
||||
/* Define if accept4 function is supported */
|
||||
#undef HAVE_ACCEPT4
|
||||
|
||||
/* Define to 1 if you have the `acquire_sem' function. */
|
||||
#undef HAVE_ACQUIRE_SEM
|
||||
|
||||
/* Define to 1 if you have the `acquire_sem_etc' function. */
|
||||
#undef HAVE_ACQUIRE_SEM_ETC
|
||||
|
||||
/* Define if async i/o supports message q's */
|
||||
#undef HAVE_AIO_MSGQ
|
||||
|
||||
@ -99,6 +105,9 @@
|
||||
*/
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define to 1 if you have the `arc4random_buf' function. */
|
||||
#undef HAVE_ARC4RANDOM_BUF
|
||||
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#undef HAVE_ARPA_INET_H
|
||||
|
||||
@ -129,6 +138,10 @@
|
||||
/* Define to 1 if you have the <ctype.h> header file. */
|
||||
#undef HAVE_CTYPE_H
|
||||
|
||||
/* Define to 1 if you have the declaration of `SYS_getrandom', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_SYS_GETRANDOM
|
||||
|
||||
/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_SYS_SIGLIST
|
||||
@ -217,6 +230,9 @@
|
||||
/* Define to 1 if you have the `getpwuid_r' function. */
|
||||
#undef HAVE_GETPWUID_R
|
||||
|
||||
/* Define to 1 if you have the `getrandom' function. */
|
||||
#undef HAVE_GETRANDOM
|
||||
|
||||
/* Define to 1 if you have the `getrlimit' function. */
|
||||
#undef HAVE_GETRLIMIT
|
||||
|
||||
@ -232,6 +248,12 @@
|
||||
/* Define if hstrerror is present */
|
||||
#undef HAVE_HSTRERROR
|
||||
|
||||
/* Define to 1 if you have the `if_indextoname' function. */
|
||||
#undef HAVE_IF_INDEXTONAME
|
||||
|
||||
/* Define to 1 if you have the `if_nametoindex' function. */
|
||||
#undef HAVE_IF_NAMETOINDEX
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
@ -265,6 +287,9 @@
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/* Define to 1 if you have the <linux/random.h> header file. */
|
||||
#undef HAVE_LINUX_RANDOM_H
|
||||
|
||||
/* Define to 1 if you have the `localtime_r' function. */
|
||||
#undef HAVE_LOCALTIME_R
|
||||
|
||||
@ -361,6 +386,9 @@
|
||||
/* Define to 1 if you have the `pthread_attr_setguardsize' function. */
|
||||
#undef HAVE_PTHREAD_ATTR_SETGUARDSIZE
|
||||
|
||||
/* Define to 1 if you have the `pthread_condattr_setpshared' function. */
|
||||
#undef HAVE_PTHREAD_CONDATTR_SETPSHARED
|
||||
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
#undef HAVE_PTHREAD_H
|
||||
|
||||
@ -376,6 +404,12 @@
|
||||
/* Define if cross-process robust mutexes are available */
|
||||
#undef HAVE_PTHREAD_MUTEX_ROBUST
|
||||
|
||||
/* Define if non-posix/portable cross-process robust mutexes are available */
|
||||
#undef HAVE_PTHREAD_MUTEX_ROBUST_NP
|
||||
|
||||
/* Define to 1 if you have the `pthread_mutex_timedlock' function. */
|
||||
#undef HAVE_PTHREAD_MUTEX_TIMEDLOCK
|
||||
|
||||
/* Define if PTHREAD_PROCESS_SHARED is defined in pthread.h */
|
||||
#undef HAVE_PTHREAD_PROCESS_SHARED
|
||||
|
||||
@ -412,12 +446,21 @@
|
||||
/* Define to 1 if you have the `semget' function. */
|
||||
#undef HAVE_SEMGET
|
||||
|
||||
/* Define to 1 if you have the `semop' function. */
|
||||
#undef HAVE_SEMOP
|
||||
|
||||
/* Define to 1 if you have the `semtimedop' function. */
|
||||
#undef HAVE_SEMTIMEDOP
|
||||
|
||||
/* Define to 1 if you have the `sem_close' function. */
|
||||
#undef HAVE_SEM_CLOSE
|
||||
|
||||
/* Define to 1 if you have the `sem_post' function. */
|
||||
#undef HAVE_SEM_POST
|
||||
|
||||
/* Define to 1 if you have the `sem_timedwait' function. */
|
||||
#undef HAVE_SEM_TIMEDWAIT
|
||||
|
||||
/* Define if SEM_UNDO is defined in sys/sem.h */
|
||||
#undef HAVE_SEM_UNDO
|
||||
|
||||
@ -601,6 +644,9 @@
|
||||
/* Define to 1 if you have the <sys/poll.h> header file. */
|
||||
#undef HAVE_SYS_POLL_H
|
||||
|
||||
/* Define to 1 if you have the <sys/random.h> header file. */
|
||||
#undef HAVE_SYS_RANDOM_H
|
||||
|
||||
/* Define to 1 if you have the <sys/resource.h> header file. */
|
||||
#undef HAVE_SYS_RESOURCE_H
|
||||
|
||||
@ -628,6 +674,9 @@
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/syscall.h> header file. */
|
||||
#undef HAVE_SYS_SYSCALL_H
|
||||
|
||||
/* Define to 1 if you have the <sys/sysctl.h> header file. */
|
||||
#undef HAVE_SYS_SYSCTL_H
|
||||
|
||||
@ -763,7 +812,7 @@
|
||||
/* Define if pthread_getspecific() has two args */
|
||||
#undef PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS
|
||||
|
||||
/* Define if readdir is thread safe */
|
||||
/* Modern readdir is thread safe */
|
||||
#undef READDIR_IS_THREAD_SAFE
|
||||
|
||||
/* Define to 1 if the `setpgrp' function takes no argument. */
|
||||
@ -825,6 +874,9 @@
|
||||
/* Define if SysV semaphores affect threads within the process */
|
||||
#undef SYSVSEM_IS_GLOBAL
|
||||
|
||||
/* Define system call of random */
|
||||
#undef SYS_RANDOM
|
||||
|
||||
/* Define if use of generic atomics is requested */
|
||||
#undef USE_ATOMICS_GENERIC
|
||||
|
||||
@ -837,6 +889,9 @@
|
||||
/* Define if 4.2BSD-style flock() will be used */
|
||||
#undef USE_FLOCK_SERIALIZE
|
||||
|
||||
/* Define if pthread pshared mutex will be used */
|
||||
#undef USE_PROC_PTHREAD_SERIALIZE
|
||||
|
||||
/* Define if BeOS areas will be used */
|
||||
#undef USE_SHMEM_BEOS
|
||||
|
||||
|
84
include/private/apr_encode_private.h
Normal file
84
include/private/apr_encode_private.h
Normal file
@ -0,0 +1,84 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file apr_encode_private.h
|
||||
* @brief APR-UTIL Encoding Private
|
||||
*/
|
||||
#ifndef APR_ENCODE_PRIVATE_H
|
||||
#define APR_ENCODE_PRIVATE_H
|
||||
|
||||
#include "apr.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup APR_Util_Encode_Private
|
||||
* @ingroup APR_Util
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if APR_CHARSET_EBCDIC
|
||||
static int convert_a2e[256] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F,
|
||||
0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61,
|
||||
0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F,
|
||||
0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6,
|
||||
0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D,
|
||||
0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
|
||||
0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x06, 0x17, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x09, 0x0A, 0x1B,
|
||||
0x30, 0x31, 0x1A, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3A, 0x3B, 0x04, 0x14, 0x3E, 0xFF,
|
||||
0x41, 0xAA, 0x4A, 0xB1, 0x9F, 0xB2, 0x6A, 0xB5, 0xBB, 0xB4, 0x9A, 0x8A, 0xB0, 0xCA, 0xAF, 0xBC,
|
||||
0x90, 0x8F, 0xEA, 0xFA, 0xBE, 0xA0, 0xB6, 0xB3, 0x9D, 0xDA, 0x9B, 0x8B, 0xB7, 0xB8, 0xB9, 0xAB,
|
||||
0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9E, 0x68, 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77,
|
||||
0xAC, 0x69, 0xED, 0xEE, 0xEB, 0xEF, 0xEC, 0xBF, 0x80, 0xFD, 0xFE, 0xFB, 0xFC, 0xBA, 0xAE, 0x59,
|
||||
0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9C, 0x48, 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57,
|
||||
0x8C, 0x49, 0xCD, 0xCE, 0xCB, 0xCF, 0xCC, 0xE1, 0x70, 0xDD, 0xDE, 0xDB, 0xDC, 0x8D, 0x8E, 0xDF};
|
||||
|
||||
static int convert_e2a[256] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x10, 0x11, 0x12, 0x13, 0x9D, 0x0A, 0x08, 0x87, 0x18, 0x19, 0x92, 0x8F, 0x1C, 0x1D, 0x1E, 0x1F,
|
||||
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x17, 0x1B, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x05, 0x06, 0x07,
|
||||
0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, 0x98, 0x99, 0x9A, 0x9B, 0x14, 0x15, 0x9E, 0x1A,
|
||||
0x20, 0xA0, 0xE2, 0xE4, 0xE0, 0xE1, 0xE3, 0xE5, 0xE7, 0xF1, 0xA2, 0x2E, 0x3C, 0x28, 0x2B, 0x7C,
|
||||
0x26, 0xE9, 0xEA, 0xEB, 0xE8, 0xED, 0xEE, 0xEF, 0xEC, 0xDF, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0x5E,
|
||||
0x2D, 0x2F, 0xC2, 0xC4, 0xC0, 0xC1, 0xC3, 0xC5, 0xC7, 0xD1, 0xA6, 0x2C, 0x25, 0x5F, 0x3E, 0x3F,
|
||||
0xF8, 0xC9, 0xCA, 0xCB, 0xC8, 0xCD, 0xCE, 0xCF, 0xCC, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22,
|
||||
0xD8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0xAB, 0xBB, 0xF0, 0xFD, 0xFE, 0xB1,
|
||||
0xB0, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0xAA, 0xBA, 0xE6, 0xB8, 0xC6, 0xA4,
|
||||
0xB5, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0xA1, 0xBF, 0xD0, 0x5B, 0xDE, 0xAE,
|
||||
0xAC, 0xA3, 0xA5, 0xB7, 0xA9, 0xA7, 0xB6, 0xBC, 0xBD, 0xBE, 0xDD, 0xA8, 0xAF, 0x5D, 0xB4, 0xD7,
|
||||
0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0xAD, 0xF4, 0xF6, 0xF2, 0xF3, 0xF5,
|
||||
0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0xB9, 0xFB, 0xFC, 0xF9, 0xFA, 0xFF,
|
||||
0x5C, 0xF7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0xB2, 0xD4, 0xD6, 0xD2, 0xD3, 0xD5,
|
||||
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0xB3, 0xDB, 0xDC, 0xD9, 0xDA, 0x9F};
|
||||
#define decode ENCODE_TO_ASCII(ch) convert_e2a[(unsigned char)ch]
|
||||
#define decode ENCODE_TO_NATIVE(ch) convert_a2e[(unsigned char)ch]
|
||||
#else /* APR_CHARSET_EBCDIC */
|
||||
#define ENCODE_TO_ASCII(ch) (ch)
|
||||
#define ENCODE_TO_NATIVE(ch) (ch)
|
||||
#endif /* !APR_CHARSET_EBCDIC */
|
||||
|
||||
/** @} */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !APR_ENCODE_PRIVATE_H */
|
16
libapr.dsp
16
libapr.dsp
@ -45,7 +45,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "./include/private" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
@ -77,7 +77,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c
|
||||
# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c
|
||||
# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "./include/private" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
@ -109,7 +109,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "./include/private" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
@ -141,7 +141,7 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c
|
||||
# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c
|
||||
# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "./include/private" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
@ -177,6 +177,10 @@ PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).ma
|
||||
|
||||
SOURCE=.\atomic\win32\apr_atomic.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\atomic\win32\apr_atomic64.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "dso"
|
||||
|
||||
@ -191,6 +195,10 @@ SOURCE=.\dso\win32\dso.c
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\encoding\apr_encode.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\encoding\apr_escape.c
|
||||
# End Source File
|
||||
# End Group
|
||||
|
121
libapr.mak
121
libapr.mak
@ -36,13 +36,15 @@ DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : ".\Release\gen_test_char.exe" "$(OUTDIR)\libapr-1.dll" "$(DS_POSTBUILD_DEP)"
|
||||
ALL : ".\include\apr.hw" ".\include\apr_escape.h" "$(OUTDIR)\libapr-1.dll" "$(DS_POSTBUILD_DEP)"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\apr_atomic.obj"
|
||||
-@erase "$(INTDIR)\apr_atomic64.obj"
|
||||
-@erase "$(INTDIR)\apr_cpystrn.obj"
|
||||
-@erase "$(INTDIR)\apr_cpstr.obj"
|
||||
-@erase "$(INTDIR)\apr_encode.obj"
|
||||
-@erase "$(INTDIR)\apr_escape.obj"
|
||||
-@erase "$(INTDIR)\apr_fnmatch.obj"
|
||||
-@erase "$(INTDIR)\apr_getpass.obj"
|
||||
@ -130,7 +132,7 @@ CLEAN :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\libapr_src" /FD /c
|
||||
CPP_PROJ=/nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "./include/private" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\libapr_src" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
@ -171,10 +173,12 @@ BSC32_FLAGS=/nologo /o"$(OUTDIR)\libapr.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib" /MACHINE:X86 /opt:ref
|
||||
LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib" /opt:ref
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\apr_atomic.obj" \
|
||||
"$(INTDIR)\apr_atomic64.obj" \
|
||||
"$(INTDIR)\dso.obj" \
|
||||
"$(INTDIR)\apr_encode.obj" \
|
||||
"$(INTDIR)\apr_escape.obj" \
|
||||
"$(INTDIR)\buffer.obj" \
|
||||
"$(INTDIR)\copy.obj" \
|
||||
@ -276,13 +280,15 @@ DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : ".\include\apr_escape_test_char.h" ".\Debug\gen_test_char.exe" "$(OUTDIR)\libapr-1.dll" "$(DS_POSTBUILD_DEP)"
|
||||
ALL : ".\include\apr.hw" ".\include\apr_escape.h" "$(OUTDIR)\libapr-1.dll" "$(DS_POSTBUILD_DEP)"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\apr_atomic.obj"
|
||||
-@erase "$(INTDIR)\apr_atomic64.obj"
|
||||
-@erase "$(INTDIR)\apr_cpystrn.obj"
|
||||
-@erase "$(INTDIR)\apr_cpstr.obj"
|
||||
-@erase "$(INTDIR)\apr_encode.obj"
|
||||
-@erase "$(INTDIR)\apr_escape.obj"
|
||||
-@erase "$(INTDIR)\apr_fnmatch.obj"
|
||||
-@erase "$(INTDIR)\apr_getpass.obj"
|
||||
@ -370,7 +376,7 @@ CLEAN :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c
|
||||
CPP_PROJ=/nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "./include/private" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
@ -411,10 +417,12 @@ BSC32_FLAGS=/nologo /o"$(OUTDIR)\libapr.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib" /MACHINE:X86
|
||||
LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\apr_atomic.obj" \
|
||||
"$(INTDIR)\apr_atomic64.obj" \
|
||||
"$(INTDIR)\dso.obj" \
|
||||
"$(INTDIR)\apr_encode.obj" \
|
||||
"$(INTDIR)\apr_escape.obj" \
|
||||
"$(INTDIR)\buffer.obj" \
|
||||
"$(INTDIR)\copy.obj" \
|
||||
@ -516,13 +524,15 @@ DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
|
||||
OutDir=.\x64\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : ".\x64\Release\gen_test_char.exe" ".\include\apr_escape_test_char.h" "$(OUTDIR)\libapr-1.dll" "$(DS_POSTBUILD_DEP)"
|
||||
ALL : ".\include\apr.hw" ".\include\apr_escape.h" "$(OUTDIR)\libapr-1.dll" "$(DS_POSTBUILD_DEP)"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\apr_atomic.obj"
|
||||
-@erase "$(INTDIR)\apr_atomic64.obj"
|
||||
-@erase "$(INTDIR)\apr_cpystrn.obj"
|
||||
-@erase "$(INTDIR)\apr_cpstr.obj"
|
||||
-@erase "$(INTDIR)\apr_encode.obj"
|
||||
-@erase "$(INTDIR)\apr_escape.obj"
|
||||
-@erase "$(INTDIR)\apr_fnmatch.obj"
|
||||
-@erase "$(INTDIR)\apr_getpass.obj"
|
||||
@ -610,7 +620,7 @@ CLEAN :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\libapr_src" /FD /c
|
||||
CPP_PROJ=/nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "./include/private" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\libapr_src" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
@ -651,10 +661,12 @@ BSC32_FLAGS=/nologo /o"$(OUTDIR)\libapr.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib" /MACHINE:X64 /opt:ref
|
||||
LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib" /opt:ref
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\apr_atomic.obj" \
|
||||
"$(INTDIR)\apr_atomic64.obj" \
|
||||
"$(INTDIR)\dso.obj" \
|
||||
"$(INTDIR)\apr_encode.obj" \
|
||||
"$(INTDIR)\apr_escape.obj" \
|
||||
"$(INTDIR)\buffer.obj" \
|
||||
"$(INTDIR)\copy.obj" \
|
||||
@ -756,13 +768,15 @@ DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
|
||||
OutDir=.\x64\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : ".\x64\Debug\gen_test_char.exe" ".\include\apr_escape_test_char.h" "$(OUTDIR)\libapr-1.dll" "$(DS_POSTBUILD_DEP)"
|
||||
ALL : ".\include\apr.hw" ".\include\apr_escape.h" "$(OUTDIR)\libapr-1.dll" "$(DS_POSTBUILD_DEP)"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\apr_atomic.obj"
|
||||
-@erase "$(INTDIR)\apr_atomic64.obj"
|
||||
-@erase "$(INTDIR)\apr_cpystrn.obj"
|
||||
-@erase "$(INTDIR)\apr_cpstr.obj"
|
||||
-@erase "$(INTDIR)\apr_encode.obj"
|
||||
-@erase "$(INTDIR)\apr_escape.obj"
|
||||
-@erase "$(INTDIR)\apr_fnmatch.obj"
|
||||
-@erase "$(INTDIR)\apr_getpass.obj"
|
||||
@ -850,7 +864,7 @@ CLEAN :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c
|
||||
CPP_PROJ=/nologo /MDd /W3 /Zi /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /I "./include/private" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "WINNT" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\libapr_src" /FD /EHsc /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
@ -891,10 +905,12 @@ BSC32_FLAGS=/nologo /o"$(OUTDIR)\libapr.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib" /MACHINE:X64
|
||||
LINK32_FLAGS=kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib shell32.lib rpcrt4.lib /nologo /base:"0x6EEC0000" /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\libapr-1.pdb" /debug /out:"$(OUTDIR)\libapr-1.dll" /implib:"$(OUTDIR)\libapr-1.lib"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\apr_atomic.obj" \
|
||||
"$(INTDIR)\apr_atomic64.obj" \
|
||||
"$(INTDIR)\dso.obj" \
|
||||
"$(INTDIR)\apr_encode.obj" \
|
||||
"$(INTDIR)\apr_escape.obj" \
|
||||
"$(INTDIR)\buffer.obj" \
|
||||
"$(INTDIR)\copy.obj" \
|
||||
@ -1006,12 +1022,24 @@ SOURCE=.\atomic\win32\apr_atomic.c
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=.\atomic\win32\apr_atomic64.c
|
||||
|
||||
"$(INTDIR)\apr_atomic64.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=.\dso\win32\dso.c
|
||||
|
||||
"$(INTDIR)\dso.obj" : $(SOURCE) "$(INTDIR)" ".\include\apr.h"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=.\encoding\apr_encode.c
|
||||
|
||||
"$(INTDIR)\apr_encode.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=.\encoding\apr_escape.c
|
||||
|
||||
"$(INTDIR)\apr_escape.obj" : $(SOURCE) "$(INTDIR)" ".\include\apr_escape.h" ".\include\apr_escape_test_char.h" ".\include\apr.h"
|
||||
@ -1569,75 +1597,6 @@ InputPath=.\include\apr_escape.h
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\include\apr_want.h
|
||||
|
||||
!IF "$(CFG)" == "libapr - Win32 Release"
|
||||
|
||||
InputPath=.\include\apr_want.h
|
||||
|
||||
".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
<<tempfile.bat
|
||||
@echo off
|
||||
type .\include\apr.hw > .\include\apr.h
|
||||
<<
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "libapr - Win32 Debug"
|
||||
|
||||
InputPath=.\include\apr_want.h
|
||||
|
||||
".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
<<tempfile.bat
|
||||
@echo off
|
||||
type .\include\apr.hw > .\include\apr.h
|
||||
<<
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "libapr - Win32 Release9x"
|
||||
|
||||
InputPath=.\include\apr_want.h
|
||||
|
||||
".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
<<tempfile.bat
|
||||
@echo off
|
||||
type .\include\apr.hw > .\include\apr.h
|
||||
<<
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "libapr - Win32 Debug9x"
|
||||
|
||||
InputPath=.\include\apr_want.h
|
||||
|
||||
".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
<<tempfile.bat
|
||||
@echo off
|
||||
type .\include\apr.hw > .\include\apr.h
|
||||
<<
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "libapr - x64 Release"
|
||||
|
||||
InputPath=.\include\apr_want.h
|
||||
|
||||
".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
<<tempfile.bat
|
||||
@echo off
|
||||
type .\include\apr.hw > .\include\apr.h
|
||||
<<
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "libapr - x64 Debug"
|
||||
|
||||
InputPath=.\include\apr_want.h
|
||||
|
||||
".\include\apr_escape_test_char.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
<<tempfile.bat
|
||||
@echo off
|
||||
type .\include\apr.hw > .\include\apr.h
|
||||
<<
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\libapr.rc
|
||||
|
||||
|
@ -142,6 +142,47 @@ APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex)
|
||||
return rv;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex,
|
||||
apr_interval_time_t timeout)
|
||||
{
|
||||
#if APR_HAS_TIMEDLOCKS
|
||||
apr_status_t rv;
|
||||
|
||||
#if APR_HAS_THREADS
|
||||
if (mutex->thread_mutex) {
|
||||
apr_time_t expiry = 0;
|
||||
if (timeout > 0) {
|
||||
expiry = apr_time_now() + timeout;
|
||||
}
|
||||
rv = apr_thread_mutex_timedlock(mutex->thread_mutex, timeout);
|
||||
if (rv != APR_SUCCESS) {
|
||||
return rv;
|
||||
}
|
||||
if (expiry) {
|
||||
timeout = expiry - apr_time_now();
|
||||
if (timeout < 0) {
|
||||
timeout = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* APR_HAS_THREADS */
|
||||
|
||||
rv = apr_proc_mutex_timedlock(mutex->proc_mutex, timeout);
|
||||
|
||||
#if APR_HAS_THREADS
|
||||
if (rv != APR_SUCCESS) {
|
||||
if (mutex->thread_mutex) {
|
||||
(void)apr_thread_mutex_unlock(mutex->thread_mutex);
|
||||
}
|
||||
}
|
||||
#endif /* APR_HAS_THREADS */
|
||||
|
||||
return rv;
|
||||
#else /* APR_HAS_TIMEDLOCKS */
|
||||
return APR_ENOTIMPL;
|
||||
#endif
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex)
|
||||
{
|
||||
apr_status_t rv;
|
||||
|
@ -46,6 +46,44 @@ static apr_status_t proc_mutex_no_perms_set(apr_proc_mutex_t *mutex,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if APR_HAS_FCNTL_SERIALIZE \
|
||||
|| APR_HAS_FLOCK_SERIALIZE \
|
||||
|| (APR_HAS_SYSVSEM_SERIALIZE \
|
||||
&& !defined(HAVE_SEMTIMEDOP)) \
|
||||
|| (APR_HAS_POSIXSEM_SERIALIZE \
|
||||
&& !defined(HAVE_SEM_TIMEDWAIT)) \
|
||||
|| (APR_HAS_PROC_PTHREAD_SERIALIZE \
|
||||
&& !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) \
|
||||
&& !defined(HAVE_PTHREAD_CONDATTR_SETPSHARED))
|
||||
static apr_status_t proc_mutex_spinsleep_timedacquire(apr_proc_mutex_t *mutex,
|
||||
apr_interval_time_t timeout)
|
||||
{
|
||||
#define SLEEP_TIME apr_time_from_msec(10)
|
||||
apr_status_t rv;
|
||||
for (;;) {
|
||||
rv = apr_proc_mutex_trylock(mutex);
|
||||
if (!APR_STATUS_IS_EBUSY(rv)) {
|
||||
if (rv == APR_SUCCESS) {
|
||||
mutex->curr_locked = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (timeout <= 0) {
|
||||
rv = APR_TIMEUP;
|
||||
break;
|
||||
}
|
||||
if (timeout > SLEEP_TIME) {
|
||||
apr_sleep(SLEEP_TIME);
|
||||
timeout -= SLEEP_TIME;
|
||||
}
|
||||
else {
|
||||
apr_sleep(timeout);
|
||||
timeout = 0;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if APR_HAS_POSIXSEM_SERIALIZE
|
||||
|
||||
@ -183,6 +221,37 @@ static apr_status_t proc_mutex_posix_tryacquire(apr_proc_mutex_t *mutex)
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
#if defined(HAVE_SEM_TIMEDWAIT)
|
||||
static apr_status_t proc_mutex_posix_timedacquire(apr_proc_mutex_t *mutex,
|
||||
apr_interval_time_t timeout)
|
||||
{
|
||||
if (timeout <= 0) {
|
||||
apr_status_t rv = proc_mutex_posix_tryacquire(mutex);
|
||||
return (rv == APR_EBUSY) ? APR_TIMEUP : rv;
|
||||
}
|
||||
else {
|
||||
int rc;
|
||||
struct timespec abstime;
|
||||
|
||||
timeout += apr_time_now();
|
||||
abstime.tv_sec = apr_time_sec(timeout);
|
||||
abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */
|
||||
|
||||
do {
|
||||
rc = sem_timedwait(mutex->os.psem_interproc, &abstime);
|
||||
} while (rc < 0 && errno == EINTR);
|
||||
if (rc < 0) {
|
||||
if (errno == ETIMEDOUT) {
|
||||
return APR_TIMEUP;
|
||||
}
|
||||
return errno;
|
||||
}
|
||||
}
|
||||
mutex->curr_locked = 1;
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
static apr_status_t proc_mutex_posix_release(apr_proc_mutex_t *mutex)
|
||||
{
|
||||
mutex->curr_locked = 0;
|
||||
@ -204,6 +273,11 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_posixsem_methods =
|
||||
proc_mutex_posix_create,
|
||||
proc_mutex_posix_acquire,
|
||||
proc_mutex_posix_tryacquire,
|
||||
#if defined(HAVE_SEM_TIMEDWAIT)
|
||||
proc_mutex_posix_timedacquire,
|
||||
#else
|
||||
proc_mutex_spinsleep_timedacquire,
|
||||
#endif
|
||||
proc_mutex_posix_release,
|
||||
proc_mutex_posix_cleanup,
|
||||
proc_mutex_no_child_init,
|
||||
@ -302,6 +376,37 @@ static apr_status_t proc_mutex_sysv_tryacquire(apr_proc_mutex_t *mutex)
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
#if defined(HAVE_SEMTIMEDOP)
|
||||
static apr_status_t proc_mutex_sysv_timedacquire(apr_proc_mutex_t *mutex,
|
||||
apr_interval_time_t timeout)
|
||||
{
|
||||
if (timeout <= 0) {
|
||||
apr_status_t rv = proc_mutex_sysv_tryacquire(mutex);
|
||||
return (rv == APR_EBUSY) ? APR_TIMEUP : rv;
|
||||
}
|
||||
else {
|
||||
int rc;
|
||||
struct timespec reltime;
|
||||
|
||||
reltime.tv_sec = apr_time_sec(timeout);
|
||||
reltime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */
|
||||
|
||||
do {
|
||||
rc = semtimedop(mutex->os.crossproc, &proc_mutex_op_on, 1,
|
||||
&reltime);
|
||||
} while (rc < 0 && errno == EINTR);
|
||||
if (rc < 0) {
|
||||
if (errno == EAGAIN) {
|
||||
return APR_TIMEUP;
|
||||
}
|
||||
return errno;
|
||||
}
|
||||
}
|
||||
mutex->curr_locked = 1;
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
static apr_status_t proc_mutex_sysv_release(apr_proc_mutex_t *mutex)
|
||||
{
|
||||
int rc;
|
||||
@ -344,6 +449,11 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods =
|
||||
proc_mutex_sysv_create,
|
||||
proc_mutex_sysv_acquire,
|
||||
proc_mutex_sysv_tryacquire,
|
||||
#if defined(HAVE_SEMTIMEDOP)
|
||||
proc_mutex_sysv_timedacquire,
|
||||
#else
|
||||
proc_mutex_spinsleep_timedacquire,
|
||||
#endif
|
||||
proc_mutex_sysv_release,
|
||||
proc_mutex_sysv_cleanup,
|
||||
proc_mutex_no_child_init,
|
||||
@ -356,6 +466,12 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods =
|
||||
|
||||
#if APR_HAS_PROC_PTHREAD_SERIALIZE
|
||||
|
||||
#ifndef APR_USE_PROC_PTHREAD_MUTEX_COND
|
||||
#define APR_USE_PROC_PTHREAD_MUTEX_COND \
|
||||
(defined(HAVE_PTHREAD_CONDATTR_SETPSHARED) \
|
||||
&& !defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK))
|
||||
#endif
|
||||
|
||||
/* The mmap()ed pthread_interproc is the native pthread_mutex_t followed
|
||||
* by a refcounter to track children using it. We want to avoid calling
|
||||
* pthread_mutex_destroy() on the shared mutex area while it is in use by
|
||||
@ -366,12 +482,29 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_sysv_methods =
|
||||
* destroy it.
|
||||
*/
|
||||
typedef struct {
|
||||
#define proc_pthread_cast(m) \
|
||||
((proc_pthread_mutex_t *)(m)->os.pthread_interproc)
|
||||
pthread_mutex_t mutex;
|
||||
#define proc_pthread_mutex(m) \
|
||||
(proc_pthread_cast(m)->mutex)
|
||||
#if APR_USE_PROC_PTHREAD_MUTEX_COND
|
||||
pthread_cond_t cond;
|
||||
#define proc_pthread_mutex_cond(m) \
|
||||
(proc_pthread_cast(m)->cond)
|
||||
apr_int32_t cond_locked;
|
||||
#define proc_pthread_mutex_cond_locked(m) \
|
||||
(proc_pthread_cast(m)->cond_locked)
|
||||
apr_uint32_t cond_num_waiters;
|
||||
#define proc_pthread_mutex_cond_num_waiters(m) \
|
||||
(proc_pthread_cast(m)->cond_num_waiters)
|
||||
#define proc_pthread_mutex_is_cond(m) \
|
||||
((m)->pthread_refcounting && proc_pthread_mutex_cond_locked(m) != -1)
|
||||
#endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */
|
||||
apr_uint32_t refcount;
|
||||
#define proc_pthread_mutex_refcount(m) \
|
||||
(proc_pthread_cast(m)->refcount)
|
||||
} proc_pthread_mutex_t;
|
||||
|
||||
#define proc_pthread_mutex_refcount(m) \
|
||||
(((proc_pthread_mutex_t *)(m)->os.pthread_interproc)->refcount)
|
||||
|
||||
static APR_INLINE int proc_pthread_mutex_inc(apr_proc_mutex_t *mutex)
|
||||
{
|
||||
@ -395,8 +528,14 @@ static apr_status_t proc_pthread_mutex_unref(void *mutex_)
|
||||
apr_proc_mutex_t *mutex=mutex_;
|
||||
apr_status_t rv;
|
||||
|
||||
#if APR_USE_PROC_PTHREAD_MUTEX_COND
|
||||
if (proc_pthread_mutex_is_cond(mutex)) {
|
||||
mutex->curr_locked = 0;
|
||||
}
|
||||
else
|
||||
#endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */
|
||||
if (mutex->curr_locked == 1) {
|
||||
if ((rv = pthread_mutex_unlock(mutex->os.pthread_interproc))) {
|
||||
if ((rv = pthread_mutex_unlock(&proc_pthread_mutex(mutex)))) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
@ -404,7 +543,17 @@ static apr_status_t proc_pthread_mutex_unref(void *mutex_)
|
||||
}
|
||||
}
|
||||
if (!proc_pthread_mutex_dec(mutex)) {
|
||||
if ((rv = pthread_mutex_destroy(mutex->os.pthread_interproc))) {
|
||||
#if APR_USE_PROC_PTHREAD_MUTEX_COND
|
||||
if (proc_pthread_mutex_is_cond(mutex) &&
|
||||
(rv = pthread_cond_destroy(&proc_pthread_mutex_cond(mutex)))) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
#endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */
|
||||
|
||||
if ((rv = pthread_mutex_destroy(&proc_pthread_mutex(mutex)))) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
@ -456,6 +605,9 @@ static apr_status_t proc_mutex_pthread_create(apr_proc_mutex_t *new_mutex,
|
||||
|
||||
new_mutex->pthread_refcounting = 1;
|
||||
new_mutex->curr_locked = -1; /* until the mutex has been created */
|
||||
#if APR_USE_PROC_PTHREAD_MUTEX_COND
|
||||
proc_pthread_mutex_cond_locked(new_mutex) = -1;
|
||||
#endif
|
||||
|
||||
if ((rv = pthread_mutexattr_init(&mattr))) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
@ -473,9 +625,13 @@ static apr_status_t proc_mutex_pthread_create(apr_proc_mutex_t *new_mutex,
|
||||
return rv;
|
||||
}
|
||||
|
||||
#if defined(HAVE_PTHREAD_MUTEX_ROBUST) || defined(HAVE_PTHREAD_MUTEX_ROBUST_NP)
|
||||
#ifdef HAVE_PTHREAD_MUTEX_ROBUST
|
||||
if ((rv = pthread_mutexattr_setrobust_np(&mattr,
|
||||
PTHREAD_MUTEX_ROBUST_NP))) {
|
||||
rv = pthread_mutexattr_setrobust(&mattr, PTHREAD_MUTEX_ROBUST);
|
||||
#else
|
||||
rv = pthread_mutexattr_setrobust_np(&mattr, PTHREAD_MUTEX_ROBUST_NP);
|
||||
#endif
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
@ -491,9 +647,9 @@ static apr_status_t proc_mutex_pthread_create(apr_proc_mutex_t *new_mutex,
|
||||
pthread_mutexattr_destroy(&mattr);
|
||||
return rv;
|
||||
}
|
||||
#endif /* HAVE_PTHREAD_MUTEX_ROBUST */
|
||||
#endif /* HAVE_PTHREAD_MUTEX_ROBUST[_NP] */
|
||||
|
||||
if ((rv = pthread_mutex_init(new_mutex->os.pthread_interproc, &mattr))) {
|
||||
if ((rv = pthread_mutex_init(&proc_pthread_mutex(new_mutex), &mattr))) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
@ -532,64 +688,229 @@ static apr_status_t proc_mutex_pthread_child_init(apr_proc_mutex_t **mutex,
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
static apr_status_t proc_mutex_pthread_acquire(apr_proc_mutex_t *mutex)
|
||||
static apr_status_t proc_mutex_pthread_acquire_ex(apr_proc_mutex_t *mutex,
|
||||
apr_interval_time_t timeout)
|
||||
{
|
||||
apr_status_t rv;
|
||||
|
||||
if ((rv = pthread_mutex_lock(mutex->os.pthread_interproc))) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#if APR_USE_PROC_PTHREAD_MUTEX_COND
|
||||
if (proc_pthread_mutex_is_cond(mutex)) {
|
||||
if ((rv = pthread_mutex_lock(&proc_pthread_mutex(mutex)))) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
#if defined(HAVE_PTHREAD_MUTEX_ROBUST) || defined(HAVE_PTHREAD_MUTEX_ROBUST_NP)
|
||||
/* Okay, our owner died. Let's try to make it consistent again. */
|
||||
if (rv == EOWNERDEAD) {
|
||||
proc_pthread_mutex_dec(mutex);
|
||||
#ifdef HAVE_PTHREAD_MUTEX_ROBUST
|
||||
/* Okay, our owner died. Let's try to make it consistent again. */
|
||||
if (rv == EOWNERDEAD) {
|
||||
proc_pthread_mutex_dec(mutex);
|
||||
pthread_mutex_consistent_np(mutex->os.pthread_interproc);
|
||||
pthread_mutex_consistent(&proc_pthread_mutex(mutex));
|
||||
#else
|
||||
pthread_mutex_consistent_np(&proc_pthread_mutex(mutex));
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (!proc_pthread_mutex_cond_locked(mutex)) {
|
||||
rv = APR_SUCCESS;
|
||||
}
|
||||
else if (!timeout) {
|
||||
rv = APR_TIMEUP;
|
||||
}
|
||||
else {
|
||||
struct timespec abstime;
|
||||
|
||||
if (timeout > 0) {
|
||||
timeout += apr_time_now();
|
||||
abstime.tv_sec = apr_time_sec(timeout);
|
||||
abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */
|
||||
}
|
||||
|
||||
proc_pthread_mutex_cond_num_waiters(mutex)++;
|
||||
do {
|
||||
if (timeout < 0) {
|
||||
rv = pthread_cond_wait(&proc_pthread_mutex_cond(mutex),
|
||||
&proc_pthread_mutex(mutex));
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
rv = pthread_cond_timedwait(&proc_pthread_mutex_cond(mutex),
|
||||
&proc_pthread_mutex(mutex),
|
||||
&abstime);
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
if (rv == ETIMEDOUT) {
|
||||
rv = APR_TIMEUP;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (proc_pthread_mutex_cond_locked(mutex));
|
||||
proc_pthread_mutex_cond_num_waiters(mutex)--;
|
||||
}
|
||||
if (rv != APR_SUCCESS) {
|
||||
pthread_mutex_unlock(&proc_pthread_mutex(mutex));
|
||||
return rv;
|
||||
}
|
||||
|
||||
proc_pthread_mutex_cond_locked(mutex) = 1;
|
||||
|
||||
rv = pthread_mutex_unlock(&proc_pthread_mutex(mutex));
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */
|
||||
{
|
||||
if (timeout < 0) {
|
||||
rv = pthread_mutex_lock(&proc_pthread_mutex(mutex));
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (!timeout) {
|
||||
rv = pthread_mutex_trylock(&proc_pthread_mutex(mutex));
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
if (rv == EBUSY) {
|
||||
return APR_TIMEUP;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#if defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK)
|
||||
{
|
||||
struct timespec abstime;
|
||||
|
||||
timeout += apr_time_now();
|
||||
abstime.tv_sec = apr_time_sec(timeout);
|
||||
abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */
|
||||
|
||||
rv = pthread_mutex_timedlock(&proc_pthread_mutex(mutex), &abstime);
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
if (rv == ETIMEDOUT) {
|
||||
return APR_TIMEUP;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (rv) {
|
||||
#if defined(HAVE_PTHREAD_MUTEX_ROBUST) || defined(HAVE_PTHREAD_MUTEX_ROBUST_NP)
|
||||
/* Okay, our owner died. Let's try to make it consistent again. */
|
||||
if (rv == EOWNERDEAD) {
|
||||
proc_pthread_mutex_dec(mutex);
|
||||
#ifdef HAVE_PTHREAD_MUTEX_ROBUST
|
||||
pthread_mutex_consistent(&proc_pthread_mutex(mutex));
|
||||
#else
|
||||
pthread_mutex_consistent_np(&proc_pthread_mutex(mutex));
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
#else /* !HAVE_PTHREAD_MUTEX_TIMEDLOCK */
|
||||
return proc_mutex_spinsleep_timedacquire(mutex, timeout);
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
mutex->curr_locked = 1;
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
static apr_status_t proc_mutex_pthread_acquire(apr_proc_mutex_t *mutex)
|
||||
{
|
||||
return proc_mutex_pthread_acquire_ex(mutex, -1);
|
||||
}
|
||||
|
||||
static apr_status_t proc_mutex_pthread_tryacquire(apr_proc_mutex_t *mutex)
|
||||
{
|
||||
apr_status_t rv;
|
||||
|
||||
if ((rv = pthread_mutex_trylock(mutex->os.pthread_interproc))) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
if (rv == EBUSY) {
|
||||
return APR_EBUSY;
|
||||
}
|
||||
#ifdef HAVE_PTHREAD_MUTEX_ROBUST
|
||||
/* Okay, our owner died. Let's try to make it consistent again. */
|
||||
if (rv == EOWNERDEAD) {
|
||||
proc_pthread_mutex_dec(mutex);
|
||||
pthread_mutex_consistent_np(mutex->os.pthread_interproc);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
mutex->curr_locked = 1;
|
||||
return APR_SUCCESS;
|
||||
apr_status_t rv = proc_mutex_pthread_acquire_ex(mutex, 0);
|
||||
return (rv == APR_TIMEUP) ? APR_EBUSY : rv;
|
||||
}
|
||||
|
||||
static apr_status_t proc_mutex_pthread_timedacquire(apr_proc_mutex_t *mutex,
|
||||
apr_interval_time_t timeout)
|
||||
{
|
||||
return proc_mutex_pthread_acquire_ex(mutex, (timeout <= 0) ? 0 : timeout);
|
||||
}
|
||||
|
||||
static apr_status_t proc_mutex_pthread_release(apr_proc_mutex_t *mutex)
|
||||
{
|
||||
apr_status_t rv;
|
||||
|
||||
#if APR_USE_PROC_PTHREAD_MUTEX_COND
|
||||
if (proc_pthread_mutex_is_cond(mutex)) {
|
||||
if ((rv = pthread_mutex_lock(&proc_pthread_mutex(mutex)))) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
#if defined(HAVE_PTHREAD_MUTEX_ROBUST) || defined(HAVE_PTHREAD_MUTEX_ROBUST_NP)
|
||||
/* Okay, our owner died. Let's try to make it consistent again. */
|
||||
if (rv == EOWNERDEAD) {
|
||||
proc_pthread_mutex_dec(mutex);
|
||||
#ifdef HAVE_PTHREAD_MUTEX_ROBUST
|
||||
pthread_mutex_consistent(&proc_pthread_mutex(mutex));
|
||||
#else
|
||||
pthread_mutex_consistent_np(&proc_pthread_mutex(mutex));
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (!proc_pthread_mutex_cond_locked(mutex)) {
|
||||
rv = APR_EINVAL;
|
||||
}
|
||||
else if (!proc_pthread_mutex_cond_num_waiters(mutex)) {
|
||||
rv = APR_SUCCESS;
|
||||
}
|
||||
else {
|
||||
rv = pthread_cond_signal(&proc_pthread_mutex_cond(mutex));
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
if (rv) {
|
||||
rv = errno;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (rv != APR_SUCCESS) {
|
||||
pthread_mutex_unlock(&proc_pthread_mutex(mutex));
|
||||
return rv;
|
||||
}
|
||||
|
||||
proc_pthread_mutex_cond_locked(mutex) = 0;
|
||||
}
|
||||
#endif /* APR_USE_PROC_PTHREAD_MUTEX_COND */
|
||||
|
||||
mutex->curr_locked = 0;
|
||||
if ((rv = pthread_mutex_unlock(mutex->os.pthread_interproc))) {
|
||||
if ((rv = pthread_mutex_unlock(&proc_pthread_mutex(mutex)))) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
@ -599,6 +920,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_methods =
|
||||
proc_mutex_pthread_create,
|
||||
proc_mutex_pthread_acquire,
|
||||
proc_mutex_pthread_tryacquire,
|
||||
proc_mutex_pthread_timedacquire,
|
||||
proc_mutex_pthread_release,
|
||||
proc_mutex_pthread_cleanup,
|
||||
proc_mutex_pthread_child_init,
|
||||
@ -607,6 +929,69 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_methods =
|
||||
"pthread"
|
||||
};
|
||||
|
||||
#if APR_USE_PROC_PTHREAD_MUTEX_COND
|
||||
static apr_status_t proc_mutex_pthread_cond_create(apr_proc_mutex_t *new_mutex,
|
||||
const char *fname)
|
||||
{
|
||||
apr_status_t rv;
|
||||
pthread_condattr_t cattr;
|
||||
|
||||
rv = proc_mutex_pthread_create(new_mutex, fname);
|
||||
if (rv != APR_SUCCESS) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
if ((rv = pthread_condattr_init(&cattr))) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
apr_pool_cleanup_run(new_mutex->pool, new_mutex,
|
||||
apr_proc_mutex_cleanup);
|
||||
return rv;
|
||||
}
|
||||
if ((rv = pthread_condattr_setpshared(&cattr, PTHREAD_PROCESS_SHARED))) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
pthread_condattr_destroy(&cattr);
|
||||
apr_pool_cleanup_run(new_mutex->pool, new_mutex,
|
||||
apr_proc_mutex_cleanup);
|
||||
return rv;
|
||||
}
|
||||
if ((rv = pthread_cond_init(&proc_pthread_mutex_cond(new_mutex),
|
||||
&cattr))) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
pthread_condattr_destroy(&cattr);
|
||||
apr_pool_cleanup_run(new_mutex->pool, new_mutex,
|
||||
apr_proc_mutex_cleanup);
|
||||
return rv;
|
||||
}
|
||||
pthread_condattr_destroy(&cattr);
|
||||
|
||||
proc_pthread_mutex_cond_locked(new_mutex) = 0;
|
||||
proc_pthread_mutex_cond_num_waiters(new_mutex) = 0;
|
||||
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
static const apr_proc_mutex_unix_lock_methods_t mutex_proc_pthread_cond_methods =
|
||||
{
|
||||
APR_PROCESS_LOCK_MECH_IS_GLOBAL,
|
||||
proc_mutex_pthread_cond_create,
|
||||
proc_mutex_pthread_acquire,
|
||||
proc_mutex_pthread_tryacquire,
|
||||
proc_mutex_pthread_timedacquire,
|
||||
proc_mutex_pthread_release,
|
||||
proc_mutex_pthread_cleanup,
|
||||
proc_mutex_pthread_child_init,
|
||||
proc_mutex_no_perms_set,
|
||||
APR_LOCK_PROC_PTHREAD,
|
||||
"pthread"
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if APR_HAS_FCNTL_SERIALIZE
|
||||
@ -762,6 +1147,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_fcntl_methods =
|
||||
proc_mutex_fcntl_create,
|
||||
proc_mutex_fcntl_acquire,
|
||||
proc_mutex_fcntl_tryacquire,
|
||||
proc_mutex_spinsleep_timedacquire,
|
||||
proc_mutex_fcntl_release,
|
||||
proc_mutex_fcntl_cleanup,
|
||||
proc_mutex_no_child_init,
|
||||
@ -935,6 +1321,7 @@ static const apr_proc_mutex_unix_lock_methods_t mutex_flock_methods =
|
||||
proc_mutex_flock_create,
|
||||
proc_mutex_flock_acquire,
|
||||
proc_mutex_flock_tryacquire,
|
||||
proc_mutex_spinsleep_timedacquire,
|
||||
proc_mutex_flock_release,
|
||||
proc_mutex_flock_cleanup,
|
||||
proc_mutex_flock_child_init,
|
||||
@ -1041,6 +1428,43 @@ static apr_status_t proc_mutex_choose_method(apr_proc_mutex_t *new_mutex,
|
||||
return APR_ENOTIMPL;
|
||||
#endif
|
||||
break;
|
||||
case APR_LOCK_DEFAULT_TIMED:
|
||||
#if APR_HAS_PROC_PTHREAD_SERIALIZE \
|
||||
&& (APR_USE_PROC_PTHREAD_MUTEX_COND \
|
||||
|| defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK)) \
|
||||
&& defined(HAVE_PTHREAD_MUTEX_ROBUST)
|
||||
#if APR_USE_PROC_PTHREAD_MUTEX_COND
|
||||
new_mutex->meth = &mutex_proc_pthread_cond_methods;
|
||||
#else
|
||||
new_mutex->meth = &mutex_proc_pthread_methods;
|
||||
#endif
|
||||
if (ospmutex) {
|
||||
if (ospmutex->pthread_interproc == NULL) {
|
||||
return APR_EINVAL;
|
||||
}
|
||||
new_mutex->os.pthread_interproc = ospmutex->pthread_interproc;
|
||||
}
|
||||
break;
|
||||
#elif APR_HAS_SYSVSEM_SERIALIZE && defined(HAVE_SEMTIMEDOP)
|
||||
new_mutex->meth = &mutex_sysv_methods;
|
||||
if (ospmutex) {
|
||||
if (ospmutex->crossproc == -1) {
|
||||
return APR_EINVAL;
|
||||
}
|
||||
new_mutex->os.crossproc = ospmutex->crossproc;
|
||||
}
|
||||
break;
|
||||
#elif APR_HAS_POSIXSEM_SERIALIZE && defined(HAVE_SEM_TIMEDWAIT)
|
||||
new_mutex->meth = &mutex_posixsem_methods;
|
||||
if (ospmutex) {
|
||||
if (ospmutex->psem_interproc == NULL) {
|
||||
return APR_EINVAL;
|
||||
}
|
||||
new_mutex->os.psem_interproc = ospmutex->psem_interproc;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
/* fall trough */
|
||||
case APR_LOCK_DEFAULT:
|
||||
#if APR_USE_FLOCK_SERIALIZE
|
||||
new_mutex->meth = &mutex_flock_methods;
|
||||
@ -1156,6 +1580,16 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_trylock(apr_proc_mutex_t *mutex)
|
||||
return mutex->meth->tryacquire(mutex);
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_proc_mutex_timedlock(apr_proc_mutex_t *mutex,
|
||||
apr_interval_time_t timeout)
|
||||
{
|
||||
#if APR_HAS_TIMEDLOCKS
|
||||
return mutex->meth->timedacquire(mutex, timeout);
|
||||
#else
|
||||
return APR_ENOTIMPL;
|
||||
#endif
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_proc_mutex_unlock(apr_proc_mutex_t *mutex)
|
||||
{
|
||||
return mutex->meth->release(mutex);
|
||||
|
@ -79,21 +79,31 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond,
|
||||
apr_interval_time_t timeout)
|
||||
{
|
||||
apr_status_t rv;
|
||||
apr_time_t then;
|
||||
struct timespec abstime;
|
||||
|
||||
then = apr_time_now() + timeout;
|
||||
abstime.tv_sec = apr_time_sec(then);
|
||||
abstime.tv_nsec = apr_time_usec(then) * 1000; /* nanoseconds */
|
||||
|
||||
rv = pthread_cond_timedwait(&cond->cond, &mutex->mutex, &abstime);
|
||||
if (timeout < 0) {
|
||||
rv = pthread_cond_wait(&cond->cond, &mutex->mutex);
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
if (rv) {
|
||||
rv = errno;
|
||||
}
|
||||
if (rv) {
|
||||
rv = errno;
|
||||
}
|
||||
#endif
|
||||
if (ETIMEDOUT == rv) {
|
||||
return APR_TIMEUP;
|
||||
}
|
||||
else {
|
||||
apr_time_t then;
|
||||
struct timespec abstime;
|
||||
|
||||
then = apr_time_now() + timeout;
|
||||
abstime.tv_sec = apr_time_sec(then);
|
||||
abstime.tv_nsec = apr_time_usec(then) * 1000; /* nanoseconds */
|
||||
|
||||
rv = pthread_cond_timedwait(&cond->cond, &mutex->mutex, &abstime);
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
if (rv) {
|
||||
rv = errno;
|
||||
}
|
||||
#endif
|
||||
if (ETIMEDOUT == rv) {
|
||||
return APR_TIMEUP;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
@ -77,6 +77,19 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex,
|
||||
return rv;
|
||||
}
|
||||
|
||||
#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
|
||||
if (flags & APR_THREAD_MUTEX_TIMED) {
|
||||
rv = apr_thread_cond_create(&new_mutex->cond, pool);
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
pthread_mutex_destroy(&new_mutex->mutex);
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
apr_pool_cleanup_register(new_mutex->pool,
|
||||
new_mutex, thread_mutex_cleanup,
|
||||
apr_pool_cleanup_null);
|
||||
@ -89,13 +102,45 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex)
|
||||
{
|
||||
apr_status_t rv;
|
||||
|
||||
if (mutex->cond) {
|
||||
apr_status_t rv2;
|
||||
|
||||
rv = pthread_mutex_lock(&mutex->mutex);
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (mutex->locked) {
|
||||
mutex->num_waiters++;
|
||||
rv = apr_thread_cond_wait(mutex->cond, mutex);
|
||||
mutex->num_waiters--;
|
||||
}
|
||||
else {
|
||||
mutex->locked = 1;
|
||||
}
|
||||
|
||||
rv2 = pthread_mutex_unlock(&mutex->mutex);
|
||||
if (rv2 && !rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#else
|
||||
rv = rv2;
|
||||
#endif
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = pthread_mutex_lock(&mutex->mutex);
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
if (rv) {
|
||||
rv = errno;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -103,6 +148,36 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex)
|
||||
{
|
||||
apr_status_t rv;
|
||||
|
||||
if (mutex->cond) {
|
||||
apr_status_t rv2;
|
||||
|
||||
rv = pthread_mutex_lock(&mutex->mutex);
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (mutex->locked) {
|
||||
rv = APR_EBUSY;
|
||||
}
|
||||
else {
|
||||
mutex->locked = 1;
|
||||
}
|
||||
|
||||
rv2 = pthread_mutex_unlock(&mutex->mutex);
|
||||
if (rv2) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#else
|
||||
rv = rv2;
|
||||
#endif
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = pthread_mutex_trylock(&mutex->mutex);
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
@ -114,10 +189,121 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex)
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_thread_mutex_timedlock(apr_thread_mutex_t *mutex,
|
||||
apr_interval_time_t timeout)
|
||||
{
|
||||
apr_status_t rv = APR_ENOTIMPL;
|
||||
#if APR_HAS_TIMEDLOCKS
|
||||
|
||||
#ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK
|
||||
if (timeout <= 0) {
|
||||
rv = pthread_mutex_trylock(&mutex->mutex);
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
if (rv == EBUSY) {
|
||||
rv = APR_TIMEUP;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
struct timespec abstime;
|
||||
|
||||
timeout += apr_time_now();
|
||||
abstime.tv_sec = apr_time_sec(timeout);
|
||||
abstime.tv_nsec = apr_time_usec(timeout) * 1000; /* nanoseconds */
|
||||
|
||||
rv = pthread_mutex_timedlock(&mutex->mutex, &abstime);
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
if (rv == ETIMEDOUT) {
|
||||
rv = APR_TIMEUP;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */
|
||||
|
||||
if (mutex->cond) {
|
||||
rv = pthread_mutex_lock(&mutex->mutex);
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (mutex->locked) {
|
||||
if (timeout <= 0) {
|
||||
rv = APR_TIMEUP;
|
||||
}
|
||||
else {
|
||||
mutex->num_waiters++;
|
||||
do {
|
||||
rv = apr_thread_cond_timedwait(mutex->cond, mutex,
|
||||
timeout);
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
} while (mutex->locked);
|
||||
mutex->num_waiters--;
|
||||
}
|
||||
if (rv) {
|
||||
pthread_mutex_unlock(&mutex->mutex);
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
mutex->locked = 1;
|
||||
|
||||
rv = pthread_mutex_unlock(&mutex->mutex);
|
||||
if (rv) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
rv = errno;
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */
|
||||
|
||||
#endif /* APR_HAS_TIMEDLOCKS */
|
||||
return rv;
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex)
|
||||
{
|
||||
apr_status_t status;
|
||||
|
||||
if (mutex->cond) {
|
||||
status = pthread_mutex_lock(&mutex->mutex);
|
||||
if (status) {
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
status = errno;
|
||||
#endif
|
||||
return status;
|
||||
}
|
||||
|
||||
if (!mutex->locked) {
|
||||
status = APR_EINVAL;
|
||||
}
|
||||
else if (mutex->num_waiters) {
|
||||
status = apr_thread_cond_signal(mutex->cond);
|
||||
}
|
||||
if (status) {
|
||||
pthread_mutex_unlock(&mutex->mutex);
|
||||
return status;
|
||||
}
|
||||
|
||||
mutex->locked = 0;
|
||||
}
|
||||
|
||||
status = pthread_mutex_unlock(&mutex->mutex);
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
if (status) {
|
||||
@ -130,7 +316,17 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex)
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_thread_mutex_destroy(apr_thread_mutex_t *mutex)
|
||||
{
|
||||
return apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup);
|
||||
apr_status_t rv, rv2 = APR_SUCCESS;
|
||||
|
||||
if (mutex->cond) {
|
||||
rv2 = apr_thread_cond_destroy(mutex->cond);
|
||||
}
|
||||
rv = apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup);
|
||||
if (rv == APR_SUCCESS) {
|
||||
rv = rv2;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
APR_POOL_IMPLEMENT_ACCESSOR(thread_mutex)
|
||||
|
136
misc/unix/rand.c
136
misc/unix/rand.c
@ -43,6 +43,31 @@
|
||||
#include <sys/uuid.h>
|
||||
#endif
|
||||
|
||||
#if defined(SYS_RANDOM)
|
||||
#if defined(HAVE_SYS_RANDOM_H) && \
|
||||
defined(HAVE_GETRANDOM)
|
||||
|
||||
#include <sys/random.h>
|
||||
#define USE_GETRANDOM
|
||||
|
||||
#elif defined(HAVE_SYS_SYSCALL_H) && \
|
||||
defined(HAVE_LINUX_RANDOM_H) && \
|
||||
defined(HAVE_DECL_SYS_GETRANDOM) && \
|
||||
HAVE_DECL_SYS_GETRANDOM
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <linux/random.h>
|
||||
#define getrandom(buf, buflen, flags) \
|
||||
syscall(SYS_getrandom, (buf), (buflen), (flags))
|
||||
#define USE_GETRANDOM
|
||||
|
||||
#endif /* HAVE_SYS_RANDOM_H */
|
||||
#endif /* SYS_RANDOM */
|
||||
|
||||
#ifndef SHUT_RDWR
|
||||
#define SHUT_RDWR 2
|
||||
#endif
|
||||
@ -87,48 +112,7 @@ APR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data)
|
||||
APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf,
|
||||
apr_size_t length)
|
||||
{
|
||||
#ifdef DEV_RANDOM
|
||||
|
||||
int fd = -1;
|
||||
|
||||
/* On BSD/OS 4.1, /dev/random gives out 8 bytes at a time, then
|
||||
* gives EOF, so reading 'length' bytes may require opening the
|
||||
* device several times. */
|
||||
do {
|
||||
apr_ssize_t rc;
|
||||
|
||||
if (fd == -1)
|
||||
if ((fd = open(DEV_RANDOM, O_RDONLY)) == -1)
|
||||
return errno;
|
||||
|
||||
do {
|
||||
rc = read(fd, buf, length);
|
||||
} while (rc == -1 && errno == EINTR);
|
||||
|
||||
if (rc < 0) {
|
||||
int errnum = errno;
|
||||
close(fd);
|
||||
return errnum;
|
||||
}
|
||||
else if (rc == 0) {
|
||||
close(fd);
|
||||
fd = -1; /* force open() again */
|
||||
}
|
||||
else {
|
||||
buf += rc;
|
||||
length -= rc;
|
||||
}
|
||||
} while (length > 0);
|
||||
|
||||
close(fd);
|
||||
#elif defined(OS2)
|
||||
static UCHAR randbyte();
|
||||
unsigned int idx;
|
||||
|
||||
for (idx=0; idx<length; idx++)
|
||||
buf[idx] = randbyte();
|
||||
|
||||
#elif defined(HAVE_EGD)
|
||||
#if defined(HAVE_EGD)
|
||||
/* use EGD-compatible socket daemon (such as EGD or PRNGd).
|
||||
* message format:
|
||||
* 0x00 (get entropy level)
|
||||
@ -224,6 +208,70 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf,
|
||||
return bad_errno;
|
||||
}
|
||||
|
||||
#elif defined(SYS_RANDOM) && defined(USE_GETRANDOM)
|
||||
|
||||
do {
|
||||
int rc;
|
||||
|
||||
rc = getrandom(buf, length, 0);
|
||||
if (rc == -1) {
|
||||
if (errno == EINTR) {
|
||||
continue;
|
||||
}
|
||||
return errno;
|
||||
}
|
||||
|
||||
buf += rc;
|
||||
length -= rc;
|
||||
} while (length > 0);
|
||||
|
||||
#elif defined(SYS_RANDOM) && defined(HAVE_ARC4RANDOM_BUF)
|
||||
|
||||
arc4random_buf(buf, length);
|
||||
|
||||
#elif defined(DEV_RANDOM)
|
||||
|
||||
int fd = -1;
|
||||
|
||||
/* On BSD/OS 4.1, /dev/random gives out 8 bytes at a time, then
|
||||
* gives EOF, so reading 'length' bytes may require opening the
|
||||
* device several times. */
|
||||
do {
|
||||
apr_ssize_t rc;
|
||||
|
||||
if (fd == -1)
|
||||
if ((fd = open(DEV_RANDOM, O_RDONLY)) == -1)
|
||||
return errno;
|
||||
|
||||
do {
|
||||
rc = read(fd, buf, length);
|
||||
} while (rc == -1 && errno == EINTR);
|
||||
|
||||
if (rc < 0) {
|
||||
int errnum = errno;
|
||||
close(fd);
|
||||
return errnum;
|
||||
}
|
||||
else if (rc == 0) {
|
||||
close(fd);
|
||||
fd = -1; /* force open() again */
|
||||
}
|
||||
else {
|
||||
buf += rc;
|
||||
length -= rc;
|
||||
}
|
||||
} while (length > 0);
|
||||
|
||||
close(fd);
|
||||
|
||||
#elif defined(OS2)
|
||||
|
||||
static UCHAR randbyte();
|
||||
unsigned int idx;
|
||||
|
||||
for (idx=0; idx<length; idx++)
|
||||
buf[idx] = randbyte();
|
||||
|
||||
#elif defined(HAVE_TRUERAND) /* use truerand */
|
||||
|
||||
extern int randbyte(void); /* from the truerand library */
|
||||
@ -235,6 +283,10 @@ APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char *buf,
|
||||
for (idx=0; idx<length; idx++)
|
||||
buf[idx] = (unsigned char) randbyte();
|
||||
|
||||
#else
|
||||
|
||||
#error APR_HAS_RANDOM defined with no implementation
|
||||
|
||||
#endif /* DEV_RANDOM */
|
||||
|
||||
return APR_SUCCESS;
|
||||
|
@ -25,6 +25,14 @@
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NET_IF_H
|
||||
#include <net/if.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_IF_INDEXTONAME) && defined(_MSC_VER)
|
||||
#include "arch/win32/apr_arch_misc.h"
|
||||
#endif
|
||||
|
||||
#define APR_WANT_STRFUNC
|
||||
#include "apr_want.h"
|
||||
|
||||
@ -125,9 +133,31 @@ APR_DECLARE(apr_status_t) apr_sockaddr_ip_getbuf(char *buf, apr_size_t buflen,
|
||||
memmove(buf, buf + strlen("::ffff:"),
|
||||
strlen(buf + strlen("::ffff:"))+1);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ensure NUL termination if the buffer is too short */
|
||||
buf[buflen-1] = '\0';
|
||||
|
||||
#ifdef HAVE_IF_INDEXTONAME
|
||||
/* Append scope name for link-local addresses. */
|
||||
if (sockaddr->family == AF_INET6
|
||||
&& IN6_IS_ADDR_LINKLOCAL((struct in6_addr *)sockaddr->ipaddr_ptr)) {
|
||||
char scbuf[IF_NAMESIZE], *p = buf + strlen(buf);
|
||||
|
||||
if (if_indextoname(sockaddr->sa.sin6.sin6_scope_id, scbuf) == scbuf) {
|
||||
/* Space check, need room for buf + '%' + scope + '\0'.
|
||||
* Assert: buflen >= strlen(buf) + strlen(scbuf) + 2
|
||||
* Equiv: buflen >= (p-buf) + strlen(buf) + 2
|
||||
* Thus, fail in inverse condition: */
|
||||
if (buflen < strlen(scbuf) + (p - buf) + 2) {
|
||||
return APR_ENOSPC;
|
||||
}
|
||||
*p++ = '%';
|
||||
memcpy(p, scbuf, strlen(scbuf) + 1);
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_IF_INDEXTONAME */
|
||||
#endif /* APR_HAVE_IPV6 */
|
||||
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
@ -900,11 +930,19 @@ APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr,
|
||||
&((struct in6_addr *)(b)->ipaddr_ptr)->s6_addr[12], \
|
||||
(a)->ipaddr_len))
|
||||
|
||||
#if APR_HAVE_IPV6
|
||||
#define SCOPE_OR_ZERO(sa_) ((sa_)->family != AF_INET6 ? 0 : \
|
||||
((sa_)->sa.sin6.sin6_scope_id))
|
||||
#else
|
||||
#define SCOPE_OR_ZERO(sa_) (0)
|
||||
#endif
|
||||
|
||||
APR_DECLARE(int) apr_sockaddr_equal(const apr_sockaddr_t *addr1,
|
||||
const apr_sockaddr_t *addr2)
|
||||
{
|
||||
if (addr1->ipaddr_len == addr2->ipaddr_len &&
|
||||
!memcmp(addr1->ipaddr_ptr, addr2->ipaddr_ptr, addr1->ipaddr_len)) {
|
||||
if (addr1->ipaddr_len == addr2->ipaddr_len
|
||||
&& !memcmp(addr1->ipaddr_ptr, addr2->ipaddr_ptr, addr1->ipaddr_len)
|
||||
&& SCOPE_OR_ZERO(addr1) == SCOPE_OR_ZERO(addr2)) {
|
||||
return 1;
|
||||
}
|
||||
#if APR_HAVE_IPV6
|
||||
@ -1183,3 +1221,64 @@ APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa)
|
||||
#endif /* APR_HAVE_IPV6 */
|
||||
return 0; /* no match */
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_sockaddr_zone_set(apr_sockaddr_t *sa,
|
||||
const char *zone_id)
|
||||
{
|
||||
#if !APR_HAVE_IPV6 || !defined(HAVE_IF_NAMETOINDEX)
|
||||
return APR_ENOTIMPL;
|
||||
#else
|
||||
unsigned int idx;
|
||||
|
||||
if (sa->family != APR_INET6
|
||||
|| !IN6_IS_ADDR_LINKLOCAL((struct in6_addr *)sa->ipaddr_ptr)) {
|
||||
return APR_EBADIP;
|
||||
}
|
||||
|
||||
idx = if_nametoindex(zone_id);
|
||||
if (idx) {
|
||||
sa->sa.sin6.sin6_scope_id = idx;
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
|
||||
if (errno != ENODEV) {
|
||||
return errno;
|
||||
}
|
||||
else {
|
||||
char *endptr;
|
||||
apr_int64_t i = apr_strtoi64(zone_id, &endptr, 10);
|
||||
|
||||
if (*endptr != '\0' || errno || i < 1 || i > APR_INT16_MAX) {
|
||||
return APR_EGENERAL;
|
||||
}
|
||||
|
||||
sa->sa.sin6.sin6_scope_id = (unsigned int) i;
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_sockaddr_zone_get(const apr_sockaddr_t *sa,
|
||||
const char **name,
|
||||
apr_uint32_t *id,
|
||||
apr_pool_t *p)
|
||||
{
|
||||
#if !APR_HAVE_IPV6 || !defined(HAVE_IF_INDEXTONAME)
|
||||
return APR_ENOTIMPL;
|
||||
#else
|
||||
if (sa->family != APR_INET6 || !sa->sa.sin6.sin6_scope_id) {
|
||||
return APR_EBADIP;
|
||||
}
|
||||
|
||||
if (name) {
|
||||
char *buf = apr_palloc(p, IF_NAMESIZE);
|
||||
if (if_indextoname(sa->sa.sin6.sin6_scope_id, buf) == NULL)
|
||||
return errno;
|
||||
*name = buf;
|
||||
}
|
||||
|
||||
if (id) *id = sa->sa.sin6.sin6_scope_id;
|
||||
|
||||
return APR_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset,
|
||||
apr_os_sock_t fd;
|
||||
int ret;
|
||||
unsigned int nget, i;
|
||||
apr_int32_t nres = 0;
|
||||
apr_int32_t j;
|
||||
pfd_elem_t *ep;
|
||||
apr_status_t rv = APR_SUCCESS;
|
||||
|
||||
@ -406,7 +406,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset,
|
||||
|
||||
pollset_lock_rings();
|
||||
|
||||
for (i = 0; i < nget; i++) {
|
||||
for (i = 0, j = 0; i < nget; i++) {
|
||||
ep = (pfd_elem_t *)pollset->p->port_set[i].portev_user;
|
||||
if ((pollset->flags & APR_POLLSET_WAKEABLE) &&
|
||||
ep->pfd.desc_type == APR_POLL_FILE &&
|
||||
@ -415,10 +415,10 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset,
|
||||
rv = APR_EINTR;
|
||||
}
|
||||
else {
|
||||
pollset->p->result_set[nres] = ep->pfd;
|
||||
pollset->p->result_set[nres].rtnevents =
|
||||
pollset->p->result_set[j] = ep->pfd;
|
||||
pollset->p->result_set[j].rtnevents =
|
||||
get_revent(pollset->p->port_set[i].portev_events);
|
||||
++nres;
|
||||
j++;
|
||||
}
|
||||
/* If the ring element is still on the query ring, move it
|
||||
* to the add ring for re-association with the event port
|
||||
@ -432,8 +432,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset,
|
||||
pfd_elem_t, link);
|
||||
}
|
||||
}
|
||||
if (nres > 0) { /* any event besides wakeup pipe? */
|
||||
*num = nres;
|
||||
if ((*num = j)) { /* any event besides wakeup pipe? */
|
||||
rv = APR_SUCCESS;
|
||||
if (descriptors) {
|
||||
*descriptors = pollset->p->result_set;
|
||||
|
@ -100,7 +100,6 @@ static char *apr_cvt(double arg, int ndigits, int *decpt, int *sign,
|
||||
arg = -arg;
|
||||
}
|
||||
arg = modf(arg, &fi);
|
||||
p1 = &buf[NDIG];
|
||||
/*
|
||||
* Do integer part
|
||||
*/
|
||||
|
@ -307,13 +307,7 @@ static void remove_sync_sigs(sigset_t *sig_mask)
|
||||
/* the rest of the signals removed from the mask in this function
|
||||
* absolutely must be removed; you cannot block synchronous signals
|
||||
* (requirement of pthreads API)
|
||||
*
|
||||
* SIGUSR2 is being removed from the mask for the convenience of
|
||||
* Purify users (Solaris, HP-UX, SGI) since Purify uses SIGUSR2
|
||||
*/
|
||||
#ifdef SIGUSR2
|
||||
sigdelset(sig_mask, SIGUSR2);
|
||||
#endif
|
||||
}
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_signal_thread(int(*signal_handler)(int signum))
|
||||
|
@ -142,9 +142,6 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, apr_time_exp_t *xt)
|
||||
static const int dayoffset[12] =
|
||||
{306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275};
|
||||
|
||||
if (xt->tm_mon < 0 || xt->tm_mon >= 12)
|
||||
return APR_EBADDATE;
|
||||
|
||||
/* shift new year to 1st March in order to make leap year calc easy */
|
||||
|
||||
if (xt->tm_mon < 2)
|
||||
|
Loading…
Reference in New Issue
Block a user