summaryrefslogtreecommitdiff
path: root/poll
Commit message (Collapse)AuthorAgeFilesLines
* Merge r1819857, r1819858, r1819860, r1819861, r1819934, r1819935 from trunk:Yann Ylavic2018-01-033-47/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | testpoll: check that the wakeup pipe is still in the pollset after returning from poll(), e.g. APR_POLLSET_PORT should re-arm it automatically. poll, port: re-add the wakeup pipe to the pollset after it triggered. Just like user fds (file, socket), otherwise it's one shot only (PR-61786). Corresponding test committed in r1819857. poll, port: no need to release and re-acquire the lock in between walking the pollset and handling the dead ring, all is simple/fast/nonblocking ops. Also, set types of "i" and "j" respectively to the ones of nget and *num. poll, port: follow up to r1819860. This test is redundant now, axe it (no functional change). poll, kqueue: save a pollfd (mem)copy per returned event. poll, epoll: pollset's pfd is not modified on poll(), mark it const. Reviewed/backported by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1819937 13f79535-47bb-0310-9956-ffa450edef68
* Merge 1805380 from trunk:Joe Orton2017-09-198-37/+37
| | | | | | | | | | * include/arch/unix/apr_arch_poll_private.h, poll/unix/poll/*.c: Constify all apr_pollcb_provider_t and apr_pollset_provider_t structures. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1808832 13f79535-47bb-0310-9956-ffa450edef68
* Catch up legacy Windows buildsGregg Lewis Smith2016-12-031-3/+3
| | | | | | | | | | | | | | | | | poll/unix/wakeup.c fix typo include/apr_cstr.h, strings/apr_cstr.c Backport r1767019 apr.dsp, apr.mak, libapr.dsp, libapr.mak, makefile.win, test/makefile.win, Add strings/apr_cstr.c Remove Win9x targets git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1772487 13f79535-47bb-0310-9956-ffa450edef68
* Merge r1759009 from trunk:Eric Covener2016-09-021-1/+2
| | | | | | | | | | | | | | | | | clear the aiocb structure used for asyncio cancel The underlying syscall sanity checks some fields we don't later specify, possibly even some fields that are n/a for a cancel operation, which may result in a cancel call failing. outstanding aysnc I/O requests are cancelled when the fd is closed, but with very long-lived sockets, failing cancels could result in elevated CPU during BP4XAIO of type select or cancel. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1759010 13f79535-47bb-0310-9956-ffa450edef68
* Merge r1755758 from trunk:Yann Ylavic2016-08-105-8/+9
| | | | | | | | | | apr_pollset_poll(): don't return a positive (nay negative in case of error) number of descriptors/events, before the returned descriptors are actually initialized. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1755765 13f79535-47bb-0310-9956-ffa450edef68
* Merge r1755746 from trunk:Yann Ylavic2016-08-101-3/+0
| | | | | | | | | apr_pollset_poll(): OS/2: follow up to r1755740. The UNIX socket is SOCK_DGRAM, so draining the pipe is another read().. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1755747 13f79535-47bb-0310-9956-ffa450edef68
* Merge r1755740 from trunk:Yann Ylavic2016-08-101-4/+14
| | | | | | | | | | | apr_pollset_poll(): OS/2: follow up to r923311 (backported to 1.6 in r1755714). Don't return APR_EINTR (woken up) unless we actually read something on the wakeup pipe (which we must drain), and also return APR_SUCCESS if at least some other event is available simultaneously. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1755742 13f79535-47bb-0310-9956-ffa450edef68
* OS/2: Protect against NULL dereference if apr_pollset_wakeup() is called for aRainer Jung2016-08-101-6/+90
| | | | | | | | | | | | | | | | non-wakeable pollset. OS/2: Implement apr_pollset_wakeup() using a unix domain socket. Also adds stubs for apr_poll_method_defname() and apr_pollset_method_name(). Backport of r923311 and r923320 from trunk. It was an addition to r899905, which itself was backported to 1.6.x in r1736521, but r923311 and r923320 were forgotten. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1755714 13f79535-47bb-0310-9956-ffa450edef68
* fix misuse of autodata in initialization of the wakeupRainer Jung2016-08-101-4/+2
| | | | | | | | | | | | | | | | pipe when the pollset was created with APR_POLLSET_NOCOPY Submitted by: Neil Conway <nrc cs.berkeley.edu> Reviewed by: trawick Backport of r932585 from trunk. It was an addition to r899905, which itself was backported to 1.6.x in r1736521, but r932585 was forgotten. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1755712 13f79535-47bb-0310-9956-ffa450edef68
* fix missing semicolonRainer Jung2016-08-101-1/+1
| | | | | | | | | | | Backport of r901088 from trunk. It was an addition to r899905, which itself was backported to 1.6.x in r1736521, but r901088 was forgotten. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1755710 13f79535-47bb-0310-9956-ffa450edef68
* fix compile failure in pollcb wakeup logicRainer Jung2016-08-101-1/+1
| | | | | | | | | | | | | on Solaris >= 10. Backport of r902077 from trunk. It was an addition to r899905, which itself was backported to 1.6.x in r1736521, but r902077 was forgotten. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1755706 13f79535-47bb-0310-9956-ffa450edef68
* Merge r1750374 from trunk:Eric Covener2016-06-271-3/+5
| | | | | | | | | | | | Fix a case where the cleanup for a pollset w/o the thread-safe flag would try to zap a random/garbage message queue identifier. In httpd, this could happen with e.g. mod_cgi's short-lived, non-threadsafe pollset. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1750375 13f79535-47bb-0310-9956-ffa450edef68
* poll/unix/z_asio.c:271]: (style) Suspicious condition (assignment +Eric Covener2016-05-191-2/+2
| | | | | | | | | comparison); Clarify expression with parentheses. PR59582 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1744602 13f79535-47bb-0310-9956-ffa450edef68
* Add apr_pollcb_wakeup(), with similar behavior toGraham Leggett2016-03-258-142/+272
| | | | | | | | apr_pollset_wakeup(). Add apr_pollcb_method_name(), with similar behavior to apr_pollset_method_name(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1736521 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1671389; apr_pollset_poll() should return APR_SUCCESSJeff Trawick2015-04-071-1/+3
| | | | | | | | and the real event if a real event occurs AND apr_pollset_wakeup() is called before apr_pollset_poll() is called and/or awakened. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1671824 13f79535-47bb-0310-9956-ffa450edef68
* Merge r1671389 from trunk:Jeff Trawick2015-04-051-3/+2
| | | | | | | | poll() implementation of apr_pollset_poll(): Return APR_EINTR as appropriate. (APR_SUCCESS was returned instead in that scenario.) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1671390 13f79535-47bb-0310-9956-ffa450edef68
* Merge r1667915 from trunk.Yann Ylavic2015-03-201-1/+12
| | | | | | | Follow up to r1089433: handle impl_pollcb_poll(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1667921 13f79535-47bb-0310-9956-ffa450edef68
* Merge r1666341, r1667914 and r1667916 from trunk.Yann Ylavic2015-03-206-41/+101
| | | | | | | apr_poll(cb): fix error paths returned values and leaks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1667919 13f79535-47bb-0310-9956-ffa450edef68
* Merge r1646891 from trunk:Eric Covener2014-12-191-0/+2
| | | | | | | | | | | | apr_pollset state fixes for z/OS Submitted By: Pat Odonnell <patod us ibm com> Committed By: covener git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1646895 13f79535-47bb-0310-9956-ffa450edef68
* Merge r1438959 from trunk:Stefan Fritsch2014-05-141-1/+1
| | | | | | | Minor fixes to quiet valgrind warnings git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1594700 13f79535-47bb-0310-9956-ffa450edef68
* backport APR_POLLSET_THREADSAFE pollset support for z/OS.Eric Covener2013-10-213-0/+781
| | | | | | | | some doxygen updates git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1534274 13f79535-47bb-0310-9956-ffa450edef68
* From trunk:Jeff Trawick2011-04-292-4/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | 1. r1089433 poll, pollset, pollcb on Windows: Handle calls with no file/socket descriptors. PR: 49882 Patch for one situation submitted by: Stefan Ruppert <sr myarm.com> Extended by: trawick 2. r1089528 fix variable initialization bug in r1089433 3. r987639 disable entire impl_pollcb_create() function if APR_HAS_THREADS instead of just inserting a return at the top 4. tiny part of r899905 move decl of loop control variables to the block where used git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1097783 13f79535-47bb-0310-9956-ffa450edef68
* grab some Windows/MinGW code tweaks from trunk for quieter gcc buildsJeff Trawick2011-03-221-8/+0
| | | | | | | | | | | | time/win32/timestr.c: all of r892188 include/arch/win32/apr_arch_file_io.h: part of r892386 misc/win32/rand.c: all of r892426 misc/win32/misc.c: part of r892177 misc/win32/internal.c: all of r892390 poll/unix/pollset.c: part of r892386 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1084310 13f79535-47bb-0310-9956-ffa450edef68
* Merge r933271 from trunk:Jeff Trawick2010-04-121-0/+3
| | | | | | | | | | | apr_pollset_create_ex(): Trap errors from pollset providers. PR: 49094 Submitted by: Sami Tolvanen <sami.tolvanen mywot.com> Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@933274 13f79535-47bb-0310-9956-ffa450edef68
* backport from trunk r932585:Jeff Trawick2010-04-091-15/+14
| | | | | | | | | | | fix misuse of autodata in initialization of the wakeup pipe when the pollset was created with APR_POLLSET_NOCOPY Submitted by: Neil Conway <nrc cs.berkeley.edu> Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@932599 13f79535-47bb-0310-9956-ffa450edef68
* merge r834040 from trunk:Jeff Trawick2009-11-142-16/+22
| | | | | | | | | | | fix special poll() processing on Win32 to be consistent between . apr_{pollset|pollcb}_create_ex(..., APR_POLLSET_DEFAULT) and . apr_{pollset|pollcb}_create(...) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@836107 13f79535-47bb-0310-9956-ffa450edef68
* merge r834029 from trunk:Jeff Trawick2009-11-142-28/+30
| | | | | | | | | | | | apr_pollset_create_ex(), apr_pollcb_create_ex(): simplify logic to update the caller's pollcb/pollset ptr, fixing a apr_pollcb_create_ex() crash in one of the fall-back paths which was reported by Neil Conway git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@836105 13f79535-47bb-0310-9956-ffa450edef68
* merge r836091 from trunk:Jeff Trawick2009-11-141-2/+8
| | | | | | | | | | | | Check that an event was actually filled in when port_getn() returns -1/EINTR with nget > 0. This resolves a crash when receiving a signal. PR: 48030 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@836098 13f79535-47bb-0310-9956-ffa450edef68
* merge r834136 from trunk:Jeff Trawick2009-11-141-1/+1
| | | | | | | | | | | | | | | | | fix pollcb hangs on Solaris when using Event Ports passing nget=n will block until n events are available (or timeout/signal occurs) possible future optimization: in order to retrieve 1 or more events, first call port_getn() with nget=0 to find out how many events are available, then call it again with the number available git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@836096 13f79535-47bb-0310-9956-ffa450edef68
* merge r829789 from trunk:Jeff Trawick2009-10-261-1/+4
| | | | | | | | | | | | | | | Work around bogus return code in some circumstances with 32-bit port_getn() on Solaris 10 x86. AFAICT this problem only occurs when the return code should be zero, so changing the return code check should be sufficient. APR 1.3.8 wasn't affected. PR: 48029 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@829801 13f79535-47bb-0310-9956-ffa450edef68
* Finish backport of poll changes from trunk.Jim Jagielski2009-10-022-0/+513
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@821200 13f79535-47bb-0310-9956-ffa450edef68
* Backport all poll changes from r734707 up to nowJim Jagielski2009-10-026-1043/+706
| | | | | | | from trunk. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@821199 13f79535-47bb-0310-9956-ffa450edef68
* bypass v. weird warningJim Jagielski2009-09-171-1/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@816362 13f79535-47bb-0310-9956-ffa450edef68
* backport r807263 from trunk:Jeff Trawick2009-08-241-52/+60
| | | | | | | | | | Fix an error handling issue in the Event Port backend for APR pollsets. (ETIME is sometimes reported along with an event.) PR: 47645 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@807265 13f79535-47bb-0310-9956-ffa450edef68
* backport the following relatively simple Event Port fixes from trunk:Jeff Trawick2009-08-201-54/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r749049 commentary, consistency, simplification, and minor fixes impl_pollset_create(): . return the actual port_create() failure instead of APR_ENOMEM impl_pollset_add(): . return the actual port_associate() failure instead of APR_ENOMEM impl_pollset_poll(): . catch port_associate() failures . don't report returned events to caller unless something popped besides the wakeup pipe impl_pollcb_poll(): . fix incorrect mapping of EINTR onto APR_TIMEUP . don't hide interesting error codes behind APR_EGENERAL generally: . axe redundant APR_RING_EMPTY() invocations . don't check for EINTR explicitly, as it is handled appropriately by the apr_get_netos_error() invocation (IOW, EINTR == APR_EINTR here) r749490 (only the port.c portion) pollset tweaks: axe logic to set ignored conditions in the poll request structures (these conditions are return-only and are always reported when they occur) r750279 don't lose track of a ring element when port_associate() fails r754294 (only the port.c portion) nelts, the number of elements in the pollset, was neither needed nor properly maintained by these implementations, so axe the related code Additional, more complex fixes only in trunk at this point: r750277, r750708, r750744 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@806150 13f79535-47bb-0310-9956-ffa450edef68
* Backport r747990, r748361, r748371, r748565, r748988, r749810, r783958Bojan Smojver2009-06-123-1/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@783970 13f79535-47bb-0310-9956-ffa450edef68
* Fix core on win32 when using wakeable pollsetMladen Turk2009-02-121-0/+17
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@743730 13f79535-47bb-0310-9956-ffa450edef68
* Backport r742921 from trunkMladen Turk2009-02-121-1/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@743721 13f79535-47bb-0310-9956-ffa450edef68
* Merge r734707 from trunk:Jeff Trawick2009-01-211-1/+1
| | | | | | | | | suppress gcc's warning about unexpected assignmet "gcc version 4.0.1 (Apple Inc. build 5490)" git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@736310 13f79535-47bb-0310-9956-ffa450edef68
* Win32: Do not error out on apr_pollset_poll() when there are no sockets.Justin Erenkrantz2008-08-281-0/+11
| | | | | | | | | | * poll/unix/select.c (apr_pollset_poll): On Win32, short-circuit success if we have no sockets instead of returning an error. * CHANGES: Update. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@689896 13f79535-47bb-0310-9956-ffa450edef68
* Fix solaris poll bug - ref http://marc.info/?t=121438277000004&r=1&w=2Nick Kew2008-06-271-1/+9
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@672344 13f79535-47bb-0310-9956-ffa450edef68
* * Fix some gcc compiler warnings on SolarisRuediger Pluem2008-06-041-1/+1
| | | | | | | Patch to atomic/unix/solaris.c submitted by: Henry Jen <henryjen ztune.net> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@663342 13f79535-47bb-0310-9956-ffa450edef68
* silence warning about assignment expressionRoy T. Fielding2008-05-101-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@655138 13f79535-47bb-0310-9956-ffa450edef68
* Fix incomplete patch in r653953Nick Kew2008-05-071-0/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@654046 13f79535-47bb-0310-9956-ffa450edef68
* Fix poll failure on Solaris - PR 43000Nick Kew2008-05-061-7/+28
| | | | | | | Patch by Henry Jen git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@653953 13f79535-47bb-0310-9956-ffa450edef68
* Fix typo in r649830Nick Kew2008-05-041-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@653232 13f79535-47bb-0310-9956-ffa450edef68
* * Silence a compiler warning.Ruediger Pluem2008-04-291-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@652085 13f79535-47bb-0310-9956-ffa450edef68
* Return APR_EINTR only there was no additional descriptors signaled at the ↵Mladen Turk2008-04-215-24/+12
| | | | | | time of wakeup call git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@650118 13f79535-47bb-0310-9956-ffa450edef68
* Introduce (again) apr_pollset_wakeup APIMladen Turk2008-04-195-65/+564
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@649830 13f79535-47bb-0310-9956-ffa450edef68
* Revert r47540Mladen Turk2008-04-135-325/+29
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@647562 13f79535-47bb-0310-9956-ffa450edef68