summaryrefslogtreecommitdiff
path: root/include/arch/unix
Commit message (Collapse)AuthorAgeFilesLines
* Backport r747990, r748361, r748371, r748565, r748988, r749810, r783958bojan2009-06-221-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | from the trunk. Set CLOEXEC flags where appropriate. Either use new O_CLOEXEC flag and associated functions, such as dup3(), accept4(), epoll_create1() etc., or simply set CLOEXEC flag using fcntl(). Patch by Stefan Fritsch <sf sfritsch.de> and Arkadiusz Miskiewicz <arekm pld-linux.org>. PR 46425. fix unused variable warning for builds without HAVE_DUP3 Unroll APR_SET_FD_CLOEXEC macro. * One missing unroll of APR_SET_FD_CLOEXEC. Document CLOEXEC patch. Only set CLOEXEC on dup() if both NOCLEANUP and INHERIT flags are clear. Retain the INHERIT/NOCLEANUP flags of new_file in apr_file_dup2(). Patch by Stefan Fritsch <sf sfritsch.de>. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.3.x@787448 13f79535-47bb-0310-9956-ffa450edef68
* Backport r661146, 662114 and 662300 from the trunk.bojan2008-06-031-0/+3
| | | | | | | | | If the named resource was removed by apr_shm_remove(), it may not be there. Ignore EINVAL from shmctl in shm_cleanup_owner This fixes the testcase, but doesn't feel like the end of the story: both this and r661146 feel like sticking plaster over something deeper. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.3.x@662604 13f79535-47bb-0310-9956-ffa450edef68
* Fill in apr_fileinfo_t member st_csize on Netware and Unixwrowe2007-10-171-0/+4
| | | | | | | | | | | | | | And refine the file times down to apr_time_t resolution if supported by a st_atimensec or st_atim.tv_nsec value by the OS. Additional msec implementations are possible if exposed through autoconf. PR: 41678 Authored by: William Rowe, Nicklas Edmundsson <nikke acc.umu.se> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@585343 13f79535-47bb-0310-9956-ffa450edef68
* Prefer solaris builtins even on x86, and fix a compiler warning.davi2007-08-041-2/+2
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@562764 13f79535-47bb-0310-9956-ffa450edef68
* New apr_atomic implementation for S/390 native atomic operations.davi2007-07-071-0/+2
| | | | | | | Tested on: RHEL AS 4 (Nahant Update 4), IBM/S390, running under VM (64 bit mode), gcc 3.4.6 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@554095 13f79535-47bb-0310-9956-ffa450edef68
* New apr_atomic implementation for PowerPC native atomic operations.davi2007-07-041-0/+2
| | | | | | | PR: 42806 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@553293 13f79535-47bb-0310-9956-ffa450edef68
* New apr_atomic implementation for Solaris 10 native atomic operations.davi2007-07-041-0/+2
| | | | | | | PR: 42806 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@553292 13f79535-47bb-0310-9956-ffa450edef68
* New apr_atomic implementation for ia32 (x86 and x86_64) native atomic ↵davi2007-07-041-0/+2
| | | | | | | | | | | | operations, plus apr_atomic_casptr. PR: 42806 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@553291 13f79535-47bb-0310-9956-ffa450edef68
* Given a modern compiler, this patch provides fast atomic operations on variousdavi2007-07-041-0/+2
| | | | | | | | | | | | | | platforms (alpha, ia32, ia64, powerpc, etc). Tested on: 2x Pentium D, Ubuntu 7.04, gcc 4.1.2 16x Itanium II, RHEL 5, gcc 4.1.1 PR: 42806 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@553290 13f79535-47bb-0310-9956-ffa450edef68
* This patch tries to address some of the apr_atomic problems by reorganizingdavi2007-07-041-0/+35
| | | | | | | | | | the various backends. The generic implementation is used when no specialized implementation fits the defined criterias, or when the user forces the choice. PR: 42806 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@553289 13f79535-47bb-0310-9956-ffa450edef68
* Discard file buffers when running cleanups for exec.bojan2007-05-151-0/+1
| | | | | | | PR 41119. Original patches by Davi Arnaut. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@538045 13f79535-47bb-0310-9956-ffa450edef68
* Revert nested mutexes in Unix file_iobojan2007-05-141-0/+4
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@538009 13f79535-47bb-0310-9956-ffa450edef68
* Fix file_lock/unlock macrosbojan2007-05-121-4/+10
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@537405 13f79535-47bb-0310-9956-ffa450edef68
* Improve thread safety of assorted file_io functions.bojan2007-05-121-0/+8
| | | | | | Patches by Davi Arnaut. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@537393 13f79535-47bb-0310-9956-ffa450edef68
* reverting rev 500321 pending investigation of problem reported by jorton. gregames2007-01-291-1/+1
| | | | | | | | | | This line, and those below, will be ignored-- M include/arch/unix/apr_arch_poll_private.h M poll/unix/epoll.c git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@501085 13f79535-47bb-0310-9956-ffa450edef68
* apr_pollset_remove: speed up the httpd Event MPM when lots of connections aregregames2007-01-261-1/+1
| | | | | | | | | | in use epoll/Linux only for now. ./buildconf on FreeBSD (minotaur) spewed tons of errors; hints appreciated git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@500321 13f79535-47bb-0310-9956-ffa450edef68
* Fix the typo.jorton2006-08-0314-14/+14
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@428317 13f79535-47bb-0310-9956-ffa450edef68
* Update license header.jorton2006-08-0314-84/+84
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@428313 13f79535-47bb-0310-9956-ffa450edef68
* Implement apr_thread_yield on Unix in terms of pthread_yield or sched_yield.rooneg2006-06-301-0/+3
| | | | | | | | | | | | | | | | | Submitted by: Keisuke Nishida <keisuke.nishida gmail.com> Reviewed by: rooneg, Henry Jen <henryjen ztune.net> * configure.in: Look for pthread_yield and sched_yield. * include/arch/unix/apr_arch_threadproc.h: Include sched.h if it's present. * threadproc/unix/thread.c (apr_thread_yield): Actually do something in here... * CHANGES: Note change. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@418351 13f79535-47bb-0310-9956-ffa450edef68
* Make apr_file_t::filePtr an apr_off_t on unix so that we avoid truncatingrooneg2006-02-081-1/+1
| | | | | | | | | | | the offset into the file when working with files over 2 gigabytes in size. * include/arch/unix/apr_arch_file_io.h (apr_file_t::filePtr): Make this an apr_off_t, since we really need the full 64 bits in many cases. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@375869 13f79535-47bb-0310-9956-ffa450edef68
* Add apr-wide definitions and unix implementation of apr_file_buffer_set() and colm2005-10-181-2/+5
| | | | | | | | apr_file_buffer_size_get() functions, to support variable buffer sizes for file handles. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@326116 13f79535-47bb-0310-9956-ffa450edef68
* * include/arch/unix/apr_arch_file_io.h: Define APR_USE_READDIR64_R tojorton2005-09-271-1/+7
| | | | | | | | | | avoid cases where readdir() is used in place of readdir_r even if readdir64_r is available. * file_io/unix/dir.c (apr_dir_read): Use APR_USE_READDIR64_R. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@291973 13f79535-47bb-0310-9956-ffa450edef68
* Add some workarounds for cases where readdir_r fails due to largejorton2005-08-311-0/+4
| | | | | | | | | | | | | | | | | | | | integers in struct dirent's d_ino or d_off fields in LFS builds (seen in some peculiar NFS environments): * configure.in: Check for readdir64_r for LFS builds. * include/arch/unix/apr_arch_file_io.h (struct apr_dir_t): Use struct dirent64 for entry field if readdir64_r is present. * file_io/unix/dir.c (apr_dir_open): Use size of the entry field. (apr_dir_read): Use readdir64_r if available; check for d_ino overflow. * file_io/unix/filestat.c (fill_out_finfo): Check for inode number overflow. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@265032 13f79535-47bb-0310-9956-ffa450edef68
* Implement pool accessor for socketsmturk2005-06-121-1/+1
| | | | | | | | There is no functional change except changing stuct mamber from cntxt to pool to be able to use the ACCESSOR macros. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@190305 13f79535-47bb-0310-9956-ffa450edef68
* Update copyright year to 2005 and standardize on current copyright owner line.jerenkrantz2005-02-0414-14/+28
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@151412 13f79535-47bb-0310-9956-ffa450edef68
* Add Support for DragonFly BSD.pquerna2005-01-211-1/+2
| | | | | | | | PR: #29858 Submitted By: Jeroen Ruigrok <asmodai tendra.org> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@125880 13f79535-47bb-0310-9956-ffa450edef68
* Added apr_procattr_user_set and apr_procattr_group_set to allow setting ↵mturk2005-01-161-0/+2
| | | | | | uid/gid for newly created processes using apr_proc_create. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@125349 13f79535-47bb-0310-9956-ffa450edef68
* Fix some style problems in the poll code, no functional changes.rooneg2004-12-061-2/+2
| | | | | | | | | | | | | * include/arch/unix/apr_arch_poll_private.h (pollset_lock_rings, pollset_unlock_rings): add a space after the if. * poll/unix/port.c (apr_pollset_remove): add a space after an if. (apr_pollset_poll): wrap a long line, add a space after an if, remove some extraneous parentheses that caused a long line to go past 80 columns. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@109938 13f79535-47bb-0310-9956-ffa450edef68
* Added support for Solaris 10 Event Completion Framework aspquerna2004-11-221-1/+8
| | | | | | | | | | | | a backend to APR Pollset. Best Docs: http://developers.sun.com/solaris/articles/event_completion.html I have only been able to test this on Solaris 10 on x86 with gcc. If anyone could test on Sparc with other compilers that would be great. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@106156 13f79535-47bb-0310-9956-ffa450edef68
* This commit may break the win32 or netware builds because of the added files.pquerna2004-11-201-0/+92
| | | | | | | | | | | | | Added the APR_POLLSET_THREADSAFE flag for apr_pollset_create(). The flag is only supported by the KQueue or EPoll backends at this time. All others should return ENOTIMPL. Split poll/unix/poll.c into one file for each backend to better maintain them. Tested On: FreeBSD 5.2.1, Linux 2.6 and OS X 10.3.6. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@105905 13f79535-47bb-0310-9956-ffa450edef68
* Remove .cvsignore files.jorton2004-11-181-3/+0
| | | | | | | Tipped-of-by: Uwe Zeisberger git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@76269 13f79535-47bb-0310-9956-ffa450edef68
* Support POSIX semaphores on LP64 platforms:jorton2004-06-141-0/+3
| | | | | | | | | | | | | | | | * configure.in: Don't disable POSIX semaphore support on LP64 platforms. * include/arch/unix/apr_arch_proc_mutex.h (struct apr_proc_mutex_t): Add a sem_t pointer field. * locks/unix/proc_mutex.c (proc_mutex_posix_create, proc_mutex_posix_cleanup, proc_mutex_posix_acquire, prox_mutex_posix_release): Use the sem_t pointer not the fd for the semaphore. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65185 13f79535-47bb-0310-9956-ffa450edef68
* * include/arch/unix/apr_arch_proc_mutex.h, locks/unix/proc_mutex.c:jorton2004-06-051-16/+0
| | | | | | | Don't define global symbols for the _methods structures. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65165 13f79535-47bb-0310-9956-ffa450edef68
* * configure.in, include/arch/unix/apr_arch_proc_mutex.h,jorton2004-06-051-4/+0
| | | | | | | | include/apr.h.in: Remove unimplemented "rwlock" serialization definitions. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65164 13f79535-47bb-0310-9956-ffa450edef68
* Drop racy/broken Unix nested mutex implementation; use SUSv3-stylejorton2004-06-041-3/+0
| | | | | | | | | | | | | | | | | | | recursive mutex support if available: * build/apr_threads.m4 (APR_CHECK_PTHREAD_RECURSIVE_MUTEX): New macro. * configure.in: Use it. * include/arch/unix/apr_arch_thread_mutex.h (struct apr_thread_mutex_t): Drop nested mutex tracking fields. * locks/unix/thread_mutex.c (apr_thread_mutex_create): Return ENOTIMPL if lacking recursive mutex support, else create a recursive mutex. (apr_thread_mutex_lock, apr_thread_mutex_unlock, apr_thread_mutex_trylock): Remove nested mutex tracking. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65157 13f79535-47bb-0310-9956-ffa450edef68
* Add LFS support:jorton2004-03-271-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.in: Check for off64_t and necessary LFS functions, define apr_off_t as off64_t where available. Add --disable-lfs flag. Forward-port changes from 0.9.5 to define apr_off_t as long on systems systems with a 32-bit off_t which don't have LFS enabled. * include/apr.h.in: Let configure define APR_HAS_LARGE_FILES. * include/arch/netware/apr_arch_file_io.h: Redefine lseek and ftruncate. * include/arch/unix/apr_arch_file_io.h: Redefine stat, lstat, fstat, lseek, ftruncate here; define struct_stat. * file_io/unix/filestat.c: Use struct_stat. * file_io/unix/mktemp.c: Use mkstemp64 where available. * file_io/unix/open.c (apr_file_open): Use O_LARGEFILE by default when LFS is enabled. * file_io/unix/readwrite.c, file_io/unix/seek.c: Don't redefine lseek and ftruncate here. * mmap/unix/mmap.c (apr_mmap_create): Use mmap64 if available; otherwise check for overflow when LFS is enabled. * network_io/unix/sendrecv.c (apr_socket_sendfile) [Linux/HPUX]: Use sendfile64 if available; otherwise check for overflow when LFS is enabled. [solaris]: Use sendfilev64/sendfilevec64_t. * test/Makefile.in, test/test_apr.h, test/testlfs.c: Add tests. Reviewed by: Jeff Trawick git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65027 13f79535-47bb-0310-9956-ffa450edef68
* Relicense APR under Apache License, Version 2.0jerenkrantz2004-02-1313-637/+130
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64904 13f79535-47bb-0310-9956-ffa450edef68
* * configure.in: Fix detection of pthread rwlocks to actually fail whenjorton2004-01-261-1/+1
| | | | | | | | | | | | | pthread_rwlock_t can't be used; print and cache results of tests carried out; define HAVE_PTHREAD_RWLOCKS when rwlocks can be used. * locks/unix/thread_rwlock.c, include/arch/unix/apr_arch_thread_rwlock.h: Use new HAVE_PTHREAD_RWLOCKS define. PR: 22990 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64882 13f79535-47bb-0310-9956-ffa450edef68
* * include/arch/unix/apr_arch_thread_rwlock.h: Use result ofjorton2004-01-251-2/+2
| | | | | | | | | pthread_rwlock_init check correctly. (Possible fix for PR 22990) git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64876 13f79535-47bb-0310-9956-ffa450edef68
* * include/arch/unix/apr_arch_thread_cond.h: Store a pthread_cond_tjorton2003-12-291-1/+1
| | | | | | | | | | | | object in struct apr_thread_cond_t rather than a pointer to one. * locks/unix/thread_cond.c (apr_thread_cond_create): Adjust use of ->cond, remove ENOMEM handling. (apr_thread_cond_wait, apr_thread_cond_timedwait, apr_thread_cond_signal, apr_thread_cond_broadcast): Adjust use of ->cond. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64847 13f79535-47bb-0310-9956-ffa450edef68
* move the implementations of apr atomics out of the public header filetrawick2003-12-031-1/+1
| | | | | | | | | | | in order to . aid in keeping the different flavors consistent . prevent bug fixes from requiring that apps be rebuilt Reviewed and/or fixed by: Brad Nicholes, Greg Marr git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64803 13f79535-47bb-0310-9956-ffa450edef68
* on Unix-ish platforms, apr_wait_for_io_or_timeout() can just use poll(2)trawick2003-11-242-3/+8
| | | | | | | | | | | | | | | | | it is a perfect match for the feature set needed and avoids the setup code at object creation time currently required to use apr_pollset_poll() instead of poll(2) future: select()-based function is trivial too is any platform then left needing the support in apr/(network_io|file_io)/unix for allocating a pollset any time we create a file or socket just in case apr_wait_for_io_or_timeout() will be called? git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64794 13f79535-47bb-0310-9956-ffa450edef68
* With the removal of apr_poll(), the apr_wait_for_io_or_timeout() functiongstein2003-11-172-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | needed to be rebuilt. Specifically, it needs a pollset, but we don't want to allocate that all the time. Thus, we need to create it once at socket or file creation time, and then reuse that pollset. NOTE: this makes the library compile, but some of the test programs may not. I have also not verified this work yet (in favor of just getting it to at least compile...) For the apr_arch_*.h files, I added a pollset member to the file and socket structures. For the various open/dup/etc functions, I added the creation of that pollset whenever a file or socket is created. (I may have missed some and will verify further) For the socket create and sendrecv function, I added the creation of the pollset. (again, may have missed some, but if everybody uses alloc_socket, then we should be okay) * support/unix/waitio.c: rebuild in terms of the pollset git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64759 13f79535-47bb-0310-9956-ffa450edef68
* The use of "netmask" to hold options is a bit beyond bogus. That term hasgstein2003-11-021-5/+6
| | | | | | | | | | | | | | | an entirely different meaning in a networking context. Rename the socket field to "options". Also simplified the test/set macros to just take a socket. * include/arch/os2/apr_arch_networkio.h: * include/arch/unix/apr_arch_networkio.h: * include/arch/win32/apr_arch_networkio.h: - perform adjustments as above. change all uses. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64710 13f79535-47bb-0310-9956-ffa450edef68
* need <sys/ioctl.h> for SIOCATMARK on at least AIX and z/OS (OS/390 (MVS))trawick2003-10-151-0/+3
| | | | git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64685 13f79535-47bb-0310-9956-ffa450edef68
* Implement apr_socket_atmark, similar to socket_atmark except 1) it'swrowe2003-10-141-0/+3
| | | | | | | | | | | | | | portable, and 2) the return value is passed by a boolean (int) ref, with errors returned as an apr_status_t. The question is, how portable? sys/sockio.h seems sufficent for me on hp/ux, solaris, linux, osx, and this works on Win32. The Netware and OS2 implementations are best guesses. Submitted by: Jim Jagielski and William Rowe git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64684 13f79535-47bb-0310-9956-ffa450edef68
* * include/arch/unix/apr_arch_thread_rwlock.h: Store a pthread_rwlock_tjorton2003-10-041-1/+1
| | | | | | | | | | | | | object in struct apr_thread_rwlock_t rather than a pointer to one. * locks/unix/thread_rwlock.c (apr_thread_rwlock_create): Adjust use of ->rwlock, simplify to a single palloc call, and remove ENOMEM handling. (apr_thread_rwlock_rdlock, apr_thread_rwlock_tryrdlock, apr_thread_rwlock_wrlock, apr_thread_rwlock_trywrlock, apr_thread_rwlock_unlock): Adjust use of ->rwlock appropriately. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64681 13f79535-47bb-0310-9956-ffa450edef68
* * include/arch/unix/apr_arch_threadproc.h: Store a pthread_attr_tjorton2003-09-291-1/+1
| | | | | | | | | | | | structure in apr_threadattr_t, rather than a pointer to one. * threadproc/unix/thread.c (apr_threadattr_create): Use a single palloc call, omit ENOMEM handling. (apr_threadattr_detach_set, apr_threadattr_detach_get, apr_thread_create): Adjust use of ->attr appropriately. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64663 13f79535-47bb-0310-9956-ffa450edef68
* axe these deprecated functions:trawick2003-09-031-10/+0
| | | | | | | | | apr_getsocketopt, apr_recv, apr_recvfrom, apr_send, apr_sendfile, apr_sendto, apr_sendv, apr_setsocketopt, apr_socket_set_inherit, apr_socket_unset_inherit git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64605 13f79535-47bb-0310-9956-ffa450edef68
* Revamp apr_thread_mutex to be as thread safe, and occasionallywrowe2003-08-071-2/+3
| | | | | | | | | | | | | as reentrant as possible. Switched to atomics to preserve the incr/decr integrity. Although we previously reset the thread_id to zero, it's been pointed out on list that this is less than desireable. However, negative one isn't necessarily a good choice because several platforms have unsigned thread_t's. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64579 13f79535-47bb-0310-9956-ffa450edef68