summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Re-order the fields of 'struct apr_finfo_t' to avoid a hole and some padding.jailletc362023-02-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On x86_64, this shrinks the size of the struct from 120 to 112 bytes. Before the patch, pahole states that: struct apr_finfo_t { apr_pool_t * pool; /* 0 8 */ apr_int32_t valid; /* 8 4 */ apr_fileperms_t protection; /* 12 4 */ apr_filetype_e filetype; /* 16 4 */ apr_uid_t user; /* 20 4 */ apr_gid_t group; /* 24 4 */ /* XXX 4 bytes hole, try to pack */ apr_ino_t inode; /* 32 8 */ apr_dev_t device; /* 40 8 */ apr_int32_t nlink; /* 48 4 */ /* XXX 4 bytes hole, try to pack */ apr_off_t size; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ apr_off_t csize; /* 64 8 */ apr_time_t atime; /* 72 8 */ apr_time_t mtime; /* 80 8 */ apr_time_t ctime; /* 88 8 */ const char * fname; /* 96 8 */ const char * name; /* 104 8 */ struct apr_file_t * filehand; /* 112 8 */ /* size: 120, cachelines: 2, members: 17 */ /* sum members: 112, holes: 2, sum holes: 8 */ /* last cacheline: 56 bytes */ }; git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907750 13f79535-47bb-0310-9956-ffa450edef68
* duplicate linecovener2023-02-171-1/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907718 13f79535-47bb-0310-9956-ffa450edef68
* Re-order the fields of 'struct apr_bucket_file' to avoid a hole and some ↵jailletc362023-02-141-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | padding. Before the patch, pahole states that: struct apr_bucket_file { apr_bucket_refcount refcount; /* 0 4 */ /* XXX 4 bytes hole, try to pack */ apr_file_t * fd; /* 8 8 */ apr_pool_t * readpool; /* 16 8 */ int can_mmap; /* 24 4 */ /* XXX 4 bytes hole, try to pack */ apr_size_t read_size; /* 32 8 */ /* size: 40, cachelines: 1, members: 5 */ /* sum members: 32, holes: 2, sum holes: 8 */ /* last cacheline: 40 bytes */ }; git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1907634 13f79535-47bb-0310-9956-ffa450edef68
* Merge thread-name branch (PR 60587) [1]:ivan2023-01-212-0/+33
| | | | | | | | | * Introduce apr_thread_name_set() and apr_thread_name_get(). [1] https://bz.apache.org/bugzilla/show_bug.cgi?id=60587 [2] https://lists.apache.org/thread/z24logzc6v8tc0p2q3375cc10qo9y5yw git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906889 13f79535-47bb-0310-9956-ffa450edef68
* bump copyright for 2023covener2023-01-191-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1906809 13f79535-47bb-0310-9956-ffa450edef68
* Remove trailing whitespaces in all *.h.ivan2022-11-1977-810/+810
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905407 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1902312, r1904699 in preparation for a slightly different change.kotkov2022-10-201-6/+0
| | | | | | | | | | | | Shortlog: - r1902312: apr_socket_sendv: WIN32: Limit the number of WSABUFs allocated for a single call. - r1904699: apr_socket_sendv: WIN32: Follow up to r1902312: Avoid short writes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904714 13f79535-47bb-0310-9956-ffa450edef68
* apr_socket_sendv: WIN32: Follow up to r1902312: Avoid short writes.ylavic2022-10-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | We possibly (edge cases) can't send an entire iovec array in a single WSASend() call because structs WSABUF and iovec are ABI incompatible. To avoid breaking users that rely on full-write by apr_socket_sendv(), which supposedly is guaranteed by WSASend(), repeat the call until the given iovec array is exhausted. There is no way to provide both full-write and atomicity guarantees for apr_socket_sendv() on Windows, so we choose the former.. * include/apr_network_io.h: Document apr_socket_sendv() full-write/atomicity (non-)guarantees above the system ones. * network_io/win32/sendrecv.c(apr_socket_sendv): Change to a loop on WSASend() when needed, taking care of its API limits w.r.t. the given struct iovec. [Reverted by r1904714] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1904699 13f79535-47bb-0310-9956-ffa450edef68
* apr_thread: Provide apr_threadattr_max_free_set().ylavic2022-07-146-0/+14
| | | | | | | | | | | | | | | When creating a thread, this allows to specify the "max_free" of its pool allocator (i.e. apr_allocator_max_free_set), so that one can create thread local subpools and have their memory usage regulated on cleanup/destroy. One could achieve that already with: apr_allocator_max_free_set(apr_thread_pool_get(thread), max_free); in the thread startup function, but it's more convenient, simpler and race free to handle that in the thread attribute itself at creation time. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902715 13f79535-47bb-0310-9956-ffa450edef68
* win32: Move warning settings to CMakeLists.txt compile options instead ofivan2022-07-101-13/+0
| | | | | | | changing them in include/apr.h: otherwise any application the uses APR gets warning settings from APR. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902628 13f79535-47bb-0310-9956-ffa450edef68
* Remove declaration on removed function (status_from_res_error).ivan2022-07-091-2/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902613 13f79535-47bb-0310-9956-ffa450edef68
* Replace tabs to spaces.ivan2022-07-087-150/+150
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902583 13f79535-47bb-0310-9956-ffa450edef68
* win32: Fix build with IPv6 disabled.ivan2022-07-081-0/+4
| | | | | | | | * include/arch/win32/apr_arch_misc.h: (if_nametoindex, if_indextoname): Declare only if HAVE_IF_NAMETOINDEX/ HAVE_IF_INDEXTONAME. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902577 13f79535-47bb-0310-9956-ffa450edef68
* apr_strings: Provide apr_memzero_explicit() in APR.ylavic2022-06-281-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is handy outside apu_crypto usage, don't require users to link to APU for the feature. This commit moves the apr_crypto_memzero() implementation to apr_strings under the apr_memzero_explicit() name, and replaces the calls to the former with the latter, and apr_crypto_memzero() now calls apr_memzero_explicit() directly. * include/apr_strings.h(): Declare apr_memzero_explicit(). * strings/apr_strings.c(): Implement apr_memzero_explicit() by moving/renaming the code from apu_crypto. * crypto/apr_crypto.c(apr_crypto_memzero): Fall back to apr_memzero_explicit(). * crypto/apr_crypto.c(crypto_clear): Use apr_memzero_explicit() instead of apr_crypto_memzero(). * crypto/apr_crypto_prng.c(cprng_cleanup, cprng_stream_bytes, apr_crypto_prng_reseed, cprng_bytes, apr_crypto_prng_rekey, apr_crypto_prng_after_fork): Use apr_memzero_explicit() instead of apr_crypto_memzero(). * crypto/apr_md4.c(MD4Transform): Use apr_memzero_explicit() instead of apr_crypto_memzero(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902323 13f79535-47bb-0310-9956-ffa450edef68
* encoding: Better check inputs of apr_{encode,decode}_* functions.ylavic2022-06-272-171/+257
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check that the given sources can be encoded without overflowing. Return APR_EINVAL if the given "slen" is negative, APR_NOTFOUND if "dest" is not NULL and "src" is NULL, or APR_ENOSPC if "dest" is NULL and the source length (based on "slen" or APR_ENCODE_STRING) is too big to encode. * include/private/apr_encode_private.h(): Rename ENCODE_TO_ASCII() and ENCODE_TO_NATIVE() to respectively TO_ASCII() and TO_ENCODE(), and make them return an unsigned char. * encoding/apr_escape.c(): Use the new TO_ASCII() and TO_NATIVE(). * encoding/apr_encode.c(apr_encode_*, apr_decode_*): Forbid negative "slen" but APR_ENCODE_STRING, and use apr_size_t arithmetics to check for overflows when encoding. When "dest" is NULL, "src" can be NULL too. Better check for trailing '='s or base16's APR_ENCODE_COLON ':' separators. Rename ENCODE_TO_ASCII and ENCODE_TO_NATIVE to their new names, and remove casts to (unsigned char) now unnecessary. * include/apr_encode.h(): Update dox about acceptable inputs and returned errors. * test/testencode.c(): Tests for error conditions. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902281 13f79535-47bb-0310-9956-ffa450edef68
* atomic: Detect 32bit and 64bit atomic builtins separately.ylavic2022-06-261-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some 32bit platforms provide 32bit but not 64bit atomics, detect and distinctly set/use HAVE_ATOMIC_BUILTINS/HAVE_ATOMIC_BUILTINS64 and USE_ATOMICS_BUILTINS/USE_ATOMICS_BUILTINS64. These platforms NEED_ATOMICS_GENERIC64 as 64bit implementation. * configure.in(): Use stdint.h's uint{32,64}_t as atomic type for testing atomic builtins when available, otherwise "unsigned int" for 32bit testing and "unsigned long long" as 64bit. * configure.in(): AC_TRY_RUN each 32bit and 64bit type separately, the former determining HAVE_ATOMIC_BUILTINS and the latter HAVE_ATOMIC_BUILTINS64. * include/arch/unix/apr_arch_atomic.h(): Define USE_ATOMICS_BUILTINS64 when HAVE_ATOMIC_BUILTINS64, otherise define NEED_ATOMICS_GENERIC64 * include/arch/unix/apr_arch_atomic.h(): Check defined(__powerpc__) for USE_ATOMICS_PPC. * atomic/unix/builtins64.c(): Implement for USE_ATOMICS_BUILTINS64 only. BZ 63566. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902266 13f79535-47bb-0310-9956-ffa450edef68
* win32: Remove unused ANSI compatibility code.ivan2022-06-171-1/+0
| | | | | | | | | | | * file_io/win32/filestat.c (more_finfo): Remove code to handle MORE_OF_FSPEC. * include/arch/win32/apr_arch_file_io.h (MORE_OF_FSPEC): Remove. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902014 13f79535-47bb-0310-9956-ffa450edef68
* Bump (C)wrowe2022-03-091-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1898794 13f79535-47bb-0310-9956-ffa450edef68
* * Improve detection of _Thread_localrpluem2022-03-091-1/+3
| | | | | | | | | | GCC < 4.9 reports __STDC_VERSION__ >= 201112 but does not implement _Thread_local. Take care of this in the condition. See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203066 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1898779 13f79535-47bb-0310-9956-ffa450edef68
* Merge 'win32-pollset-wakeup-no-file-socket-emulation' branch to trunk.ivan2022-02-093-11/+31
| | | | | | | | | | Rework win32 poll wakeup implementation: - Explicitly use apr_socket_t instead of apr_file_t for wakeup `pipe` - Remove code in win32 apr_file_t implementation that emulates working with sockets as files. Sockets on Windows are not kernel objects and should be used only via Winsock API. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1897895 13f79535-47bb-0310-9956-ffa450edef68
* poll: Follow up to r1897521: Clarify what APR_POLLEXCL means.ylavic2022-01-271-1/+1
| | | | | | | | | This is to avoid the thundering herd issue when multiple threads/processes poll on the same descriptor (usually listening/to-be-accept()ed descriptors). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1897549 13f79535-47bb-0310-9956-ffa450edef68
* poll: Provide APR_POLLEXCL for exclusive wake up on systems that support it.ylavic2022-01-261-0/+1
| | | | | | | | epoll has EPOLLEXCLUSIVE, start with that. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1897521 13f79535-47bb-0310-9956-ffa450edef68
* apr_thread: Follow up to r1897207: Provide apr_thread_current_after_fork().ylavic2022-01-251-1/+7
| | | | | | | | | | | thread_local variables are not (always?) reset on fork(), so APR (and the user) needs a way to set the current_thread to NULL. Use apr_thread_current_after_fork() in apr_proc_fork()'s child process. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1897470 13f79535-47bb-0310-9956-ffa450edef68
* apr_thread: Follow up to r1897207: Make APR_HAS_THREAD_LOCAL a boolean..ylavic2022-01-251-3/+7
| | | | | | | | .. rather than a defined(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1897447 13f79535-47bb-0310-9956-ffa450edef68
* apr_thread: Use compiler's TLS to track the current apr_thread_t's pointer.ylavic2022-01-191-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All modern compilers provide a Thread Local Storage keyword that allows to store per-thread data efficiently (C++11 's thread_local, C11's _Thread_local, gcc/clang's __thread or MSVC's __declspec(thread)). Use that to have an apr_thread_t pointer associated with each thread created by apr_thread_create() or any native thread (like the process' initial thread) that registered itself with the new apr_thread_current_create() function. This mechanism allows to implement apr_thread_current() quite efficiently, if available, otherwise the function returns NULL. If available APR_HAS_THREAD_LOCAL is #define'd to 1 and the APR_THREAD_LOCAL macro is the keyword usable to register TLS variables natively. Both APR_HAS_THREAD_LOCAL and APR_THREAD_LOCAL are #undef'ined if the compiler does not provide the mechanism. This allows to test for the functionality at compile time. When APR_HAS_THREAD_LOCAL, the user can load his/her own TLS data with: apr_thread_data_get(&my_data, my_key, apr_thread_current()); and store them with: apr_thread_data_set(my_data, my_key, my_data_cleanup, apr_thread_current()); which can be nice to avoid the proliferation of native TLS keys. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1897207 13f79535-47bb-0310-9956-ffa450edef68
* apr_ring: Follow up to r1896535: Use APR_RING_{FIRST,LAST} macros.ylavic2022-01-061-6/+6
| | | | | | | | | hp->{next,prev} are APR_RING_{FIRST,LAST}(hp), so use them to make APR_RING_SPLICE_{HEAD,TAIL}() read better. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1896747 13f79535-47bb-0310-9956-ffa450edef68
* apr_ring: Don't break strict-aliasing rules in APR_RING_SPLICE_{HEAD,TAIL}().ylavic2021-12-301-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC-11 complains (see [1]) about apr_brigade_split_ex() seemingly issuing an out of bounds access, the cause being that APR_RING_SPLICE_{HEAD,TAIL}() is dereferencing an APR_RING_SENTINEL() and the cast there in not very aliasing friendly (see [2] for a great explanation by Martin Sebor). The APR (and user code) should never dereference APR_RING_SENTINEL(), it's fine as a pointer only (i.e. for comparing pointers). So this commit modifies the APR_RING_SPLICE_{HEAD,TAIL}() and APR_RING_{CONCAT,PREPEND}() macros to use the passed in APR_RING_HEAD's prev/next pointers directly instead of passing the APR_RING_SENTINEL() to APR_RING_SPLICE_{BEFORE,AFTER}(). Semantically, this also clarifies that APR_RING_{SPLICE,INSERT}_{BEFORE,AFTER}() should be called for an APR_RING_ENTRY while APR_RING_SPLICE_{HEAD,TAIL}() and APR_RING_{CONCAT,PREPEND}() are to be called with an APR_RING_HEAD. [1] In file included from ./include/apr_mmap.h:28, from ./include/apr_buckets.h:32, from buckets/apr_brigade.c:22: buckets/apr_brigade.c: In function ‘apr_brigade_split’: ./include/apr_ring.h:177:43: error: array subscript ‘struct apr_bucket[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds] 177 | #define APR_RING_NEXT(ep, link) (ep)->link.next | ~~~~~~~~~~^~~~~ ./include/apr_ring.h:247:38: note: in expansion of macro ‘APR_RING_NEXT’ 247 | APR_RING_NEXT((epN), link) = APR_RING_NEXT((lep), link); \ | ^~~~~~~~~~~~~ ./include/apr_ring.h:287:9: note: in expansion of macro ‘APR_RING_SPLICE_AFTER’ 287 | APR_RING_SPLICE_AFTER(APR_RING_SENTINEL((hp), elem, link), \ | ^~~~~~~~~~~~~~~~~~~~~ buckets/apr_brigade.c:118:9: note: in expansion of macro ‘APR_RING_SPLICE_HEAD’ 118 | APR_RING_SPLICE_HEAD(&a->list, e, f, apr_bucket, link); | ^~~~~~~~~~~~~~~~~~~~ buckets/apr_brigade.c:90:9: note: referencing an object of size 32 allocated by ‘apr_palloc’ 90 | b = apr_palloc(p, sizeof(*b)); | ^~~~~~~~~~~~~~~~~~~~~~~~~ [2] https://bugzilla.redhat.com/show_bug.cgi?id=1957353#c2 (Note that the original comment from Martin Sebor talks about the struct "_direntry" and the global variable "anchor" which relate to some httpd code using an APR_RING in a similar way than apr_bucket_brigade does. So below I allowed myself to edit the original comment to replace "_direntry" by "apr_bucket" and "anchor" by "list" (the apr_bucket_brigade's member used as the head of the ring) to make the link with the above commit message) " The message is a bit cryptic but it says that the code accesses an object (list) of some anonymous type as it was struct apr_bucket. That's invalid because objects can only be accessed by lvalues of compatible types (or char). The APR_RING_ENTRY macro is defined like so: #define APR_RING_ENTRY(elem) \ struct { \ struct elem * volatile next; \ struct elem * volatile prev; \ } so given the definition: APR_RING_ENTRY(apr_bucket) list; list can only be accessed by lvalues of its (anonymous) type but the APR_RING_SENTINEL() macro defined like so: #define APR_RING_SENTINEL(hp, elem, link) \ (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link)) casts the address of list's next member minus some constant to a pointer to struct apr_bucket and that pointer is then used to access the prev pointer. The anonymous struct and struct apr_bucket are unrelated and cannot be used each other's members even if the corresponding members have the same type and are at the same offset within the bounds of the object. " git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1896535 13f79535-47bb-0310-9956-ffa450edef68
* Get rid of useless APU_DSO_MODULE_BUILD for CMakemturk2021-12-031-3/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895530 13f79535-47bb-0310-9956-ffa450edef68
* Add support for building sqlite3 dbd module ... It compiles and pass testsmturk2021-12-031-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895526 13f79535-47bb-0310-9956-ffa450edef68
* Use standard configure options for dbd ODBCmturk2021-12-031-7/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895523 13f79535-47bb-0310-9956-ffa450edef68
* Stage 3 in cleaning win95 code ... cleanup headersmturk2021-12-021-24/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895511 13f79535-47bb-0310-9956-ffa450edef68
* Stage 2 in dissmantling _WIN_32_WCE ... cleanup private header filesmturk2021-12-024-18/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895507 13f79535-47bb-0310-9956-ffa450edef68
* Stage 1 in dissmantling _WIN_32_WCE ... cleanup header filesmturk2021-12-023-72/+52
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895506 13f79535-47bb-0310-9956-ffa450edef68
* Add support for APU_HAS_ICONV optionmturk2021-12-022-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895501 13f79535-47bb-0310-9956-ffa450edef68
* Use enum instead multiple booleansmturk2021-11-191-1/+7
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895181 13f79535-47bb-0310-9956-ffa450edef68
* Sync WIN32 local function names with 1.7.x branch -- no functional changemturk2021-11-191-4/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895177 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1895106: Use less expensive atomics for wakeup.ylavic2021-11-191-1/+1
| | | | | | | | | | | | | | | | | | If pipe writers (wakeup) put a single byte until it's consumed by the reader (drain), it's enough to use an atomic cas for the writers (still) and an atomic (re)set for the reader (no more cas here). This requires that the reader never blocks on read though (e.g. spurious return from poll), so make the read side on the pipe non-blocking again/finally. Since synchronous non-blocking read is not a thing for Windows' Readfile(), add a ->socket flag to this arch's apr_file_t (like the existing ->pipe one) which file_socket_pipe_create() will set to make apr_file_read/write() handle non-blocking (nor overlapped) socket pipes with WSARecv/Send(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895175 13f79535-47bb-0310-9956-ffa450edef68
* Fix drain wakeup pipe issue when multiple threads call ↵mturk2021-11-171-1/+3
| | | | | | apr_pollset_wakeup/apr_pollcb_wakeup for the same pollset filling up drain pipe. Use atomics so that wakeup call is noop if some other thread allready done this git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1895106 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1894618.ylavic2021-10-295-63/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1894619 13f79535-47bb-0310-9956-ffa450edef68
* apr_atomic: Use __atomic builtins when available.ylavic2021-10-295-0/+63
| | | | | | | | | | | Unlike Intel's atomic builtins (__sync_*), the more recent __atomic builtins provide atomic load and store for weakly ordered architectures like ARM32 or powerpc[64], so use them when available (gcc 4.6.3+). [Reverted by r1894619] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1894618 13f79535-47bb-0310-9956-ffa450edef68
* apr_brigade_split_boundary: Provide a memmem implementation on platforms thatminfrin2021-10-254-0/+4
| | | | | | | do not have one. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1894551 13f79535-47bb-0310-9956-ffa450edef68
* apr_brigades: Add apr_brigade_split_boundary(), allowing us to splitminfrin2021-10-191-0/+37
| | | | | | | brigades on boundaries of arbitrary length. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1894380 13f79535-47bb-0310-9956-ffa450edef68
* apr_crypto: s/APR_CRYPTO_CIPHER_CHACHA20_CTR/APR_CRYPTO_CIPHER_CHACHA20/gylavic2021-09-101-1/+1
| | | | | | | Chacha is a stream cipher, not a block cipher in counter mode. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1893203 13f79535-47bb-0310-9956-ffa450edef68
* poll: don't #include sys/poll.h if poll.h is available.ylavic2021-09-091-3/+1
| | | | | | | | With musl libc, this fixes: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1893198 13f79535-47bb-0310-9956-ffa450edef68
* * locks/unix/thread_mutex.c,jorton2021-07-021-0/+2
| | | | | | | | | include/arch/unix/apr_arch_thread_mutex.h: Completely drop the code required imitate the mutex via a condition variable if HAVE_PTHREAD_MUTEX_TIMEDLOCK is defined. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1891204 13f79535-47bb-0310-9956-ffa450edef68
* apr_dbm: Add dedicated apr_dbm_get_driver() function that returnsminfrin2021-06-212-8/+54
| | | | | | | | details of the driver selected and any error encountered. Add the apr_dbm_open2() function that references the driver. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1890952 13f79535-47bb-0310-9956-ffa450edef68
* Remove Windows apr_mmap_t members pstart, psize and poffset.ylavic2021-03-021-4/+0
| | | | | | | They are only used locally in apr_mmap_create(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1887062 13f79535-47bb-0310-9956-ffa450edef68
* Align apr_mmap()ing offset to a page boundary. PR 65158.ylavic2021-03-021-3/+4
| | | | | | | | | | | | | | | This is requirement for unix systems, and otherwise can cause failures or undefined behaviour with some filesystems. Add apr_mmap_t->poffset on unixes to track the offset to the previous page, relative to the user requested/actual offset. This allows ->mm and ->size to still point to the actual data, while munmap() now deletes the full range from the start of the page. Tests updated accordingly. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1887060 13f79535-47bb-0310-9956-ffa450edef68
* apr_thread: destroy the thread's pool at _join() time, unless _detach()ed.ylavic2020-12-034-0/+4
| | | | | | | | | | | | | | Destroying a joinable thread pool from apr_thread_exit() or when the thread function returns, i.e. from inside the thread itself, is racy or deadlocky with APR_POOL_DEBUG, with the parent pool being destroyed. This commit adds a ->detached flag in each arch's apr_thread_t struct to track whether a thread is detached (either at _create() or _detach() time). If detached, the pool is destroyed when the thread exits, otherwise when the thread is joined with apr_thread_join(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1884077 13f79535-47bb-0310-9956-ffa450edef68
* apr_errno: add APR_EALREADY, eventually mapped from system's [WSA]EALREADY.ylavic2020-11-271-1/+16
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1883874 13f79535-47bb-0310-9956-ffa450edef68