summaryrefslogtreecommitdiff
path: root/lib/libevent
AgeCommit message (Collapse)Author
2024-03-23In kq_del(), delete matching EV_ADD entries to prevent libevent fromYASUOKA Masahiko
passing both EV_ADD and EV_DELETE for the same fd to kevent(). ok visa
2023-05-01spellingJonathan Gray
2023-04-29New manual page written by Ted Bullock,Ingo Schwarze
dropping the empty RETURN VALUES section and adding the missing "#include <stdilib.h>" below EXAMPLES.
2023-04-29Provide function prototypes for macros that take arguments,Ingo Schwarze
rename the "ev" argument to "event" to make some text read better, and get rid of colons at the ends of list tags. OK jmc@ and Ted Bullock.
2023-04-28Some wording tweaks to finish the polishing.Ingo Schwarze
While here, also correct the HISTORY section. OK jmc@
2023-04-27tiny wording tweak from Ted Bullock to make misunderstandings less likely;Ingo Schwarze
OK jmc@
2023-04-27various markup tweaks, no content change; OK jmc@Ingo Schwarze
2023-04-27various minor content corrections and improvements;Ingo Schwarze
feedback and OK jmc@ and Ted Bullock
2023-04-26New manual page written by Ted Bullock <tbullock at comlore dot com>,Ingo Schwarze
to start working on it in the tree.
2023-04-25Put ERRORS and DIAGNOSTICS information in the sections where they belong.Ingo Schwarze
More details on RETURN VALUES and ERRORS. Document all DIAGNOSTICS messages except the various malloc(3)-related ones and except those that cannot actually occur but would merely report violations of internal invariants. Shorten some wordings in this section. Using feedback from jmc@ and Ted Bullock. OK jmc@ and nicm@ on an earlier version.
2023-04-17fix double wordJonathan Gray
2023-04-10Various wording tweaks for clarity and precision, and a few for conciseness.Ingo Schwarze
OK jmc@ and Ted Bullock
2023-04-10More deduplication: talk about environment variable in one place, not two.Ingo Schwarze
Clarify that the variables only affect the event_base structure currently being created. They do not disable "library support" as a whole. Sort the variables alphabetically. OK jmc@ and Ted Bullock
2023-04-09Trim some redundant and a bit of misleading text:Ingo Schwarze
1. The values of #define'd constants are part of the ABI, but not of the API. Programmers need not worry about them and must not rely on them. Consequently, do not list these values in the SYNOPSIS. 2. libevent can be used for any event loop, not only for the main loop of a program. 3. No need to state numbers of arguments, they are obvious from the SYNOPSIS. 4. If a function is documented to require a pointer to a specific kind of object as an argument, there is no need to say passing NULL is undefined. OK jmc@ and Ted Bullock
2023-04-09Explain what it means that an API function "requires event_init(3)"Ingo Schwarze
in one place, not in two places, reducing duplication of text. Joint work with Ted Bullock. OK jmc@.
2023-04-08New manual page written by Ted Bullock <tbullock at comlore dot com>,Ingo Schwarze
providing more information and in a more systematic way than the current event(3) manual page. Not yet linked to the tree. Using input from nicm@ and jmc@.
2023-04-06Fix two documentation bugs:Ingo Schwarze
1. The function event_base_free(3) does reset the global variable to the initial state when needed. 2. The CAVEATS section got the issue backwards: multiple threads per base cause trouble, whereas multiples bases per thread do not. While here, also avoid the plural when talking about the global variable used by event_init(3): there is only one. Using input from jmc@ and from Ted Bullock.
2023-04-05Import the first of the new libevent manual pagesIngo Schwarze
written by Ted Bullock <tbullock at comlore dot com> in order to polish it in the tree. Not yet linked to the build. In particular, this documents the so far undocumented functions event_base_new(3) and event_reinit(3) and provides lots of new information regarding event_init(3) and event_base_free(3). Also using input from nicm@, jmc@, and myself, OK nicm@ jmc@.
2022-12-27spelling fixes; from paul tagliamonteJason McIntyre
ok nicm
2022-03-31man pages: add missing commas between subordinate and main clausesChristian Weisgerber
jmc@ dislikes a comma before "then" in a conditional, so leave those untouched. ok jmc@
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2019-05-08Fixed integer overflow with an excessively large amount of events.Tobias Stoeckmann
While at it: KNF and switch from reallocarray to recallocarray. ok tedu
2019-05-03Fixed endless loop/ OOB write on 64 bit systems with large buffers.Tobias Stoeckmann
If a buffer exceeds UINT_MAX (which is only possible on 64 bit systems) an endless loop or OOB write can occur in buffer-specific readline functions. Switching variables in function scope to size_t solves these issue because relevant fields in struct buffer are already size_t. ok cheloha, deraadt, nicm, tedu
2019-05-01Tweaks previous: gettime() can be void, use TIMESPEC_TO_TIMEVALJeremie Courreges-Anglas
ok nicm@ tobias@ cheloha@
2019-05-01Require clock_gettime(CLOCK_MONOTONIC) and remove fallback codeJeremie Courreges-Anglas
If clock_gettime(CLOCK_MONOTONIC) fails here, something is really wrong. Lots of userland already require it anyway. Removing the fallback code means less code, less global state and less fiddling with the timeheap internals. ok nicm@ tedu@ tobias@ cheloha@
2019-04-29Switched min_heap to size_t to prevent integer overflows.Tobias Stoeckmann
Also, as deraadt suggested, switched realloc to recallocarray to at least prevent uninitialized memory to be used as pointers in case of other programming errors. A proper solution (not using an array) needs more work. This change occured in sync with upstream libevent 2.2. with input by and ok bluhm, jca, tedu
2019-04-20knf, ok bluhmTed Unangst
2019-04-18unfold some compound operations to make this easier to followTed Unangst
2018-09-23Document bufferevent_setwatermark(). Initial diff from Geoff Hill on tech@ withanton
some tweaks. With feedback and ok jmc@
2018-07-26Mention some missing libevent macros.rob
ok jmc@, benno@, "yes" deraadt@
2017-08-01add missing and correct misspelled names, most in NAME sections;Ingo Schwarze
found with regress/usr.bin/mandoc/db/dbm_dump; OK jmc@
2017-07-10if there are no changes for kevent, pass in NULL instead.Ted Unangst
this has no effect except to make ktrace output prettier. ok bluhm mpi
2017-06-29take const off the timeval argument in the pending functions.David Gwynne
event_pending, evtimer_pending, and signal_pending all write to the timeval because that's how they tell the caller when the event is meant to fire. ok deraadt@ millert@ jmc@ schwarze@
2017-03-18Use recallocarray() to avoid leaving detritus in memory when resizingTheo de Raadt
the string buffer. ok jsing millert
2016-09-03Remove NULL pointer checks before calls to free().Nayden Markatchev
OK bluhm@ nicm@
2016-07-17Talk about event API instead of libeventStefan Kempf
Avoids inconsistent capitalization of libevent at start of sentence suggested by and ok jmc@, ok bluhm@
2016-03-30for some time now mandoc has not required MLINKS to functionJason McIntyre
correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
2016-03-20Currently we have about a 50/50 split over fcntl(n, F_GETFL [,0])Kenneth R Westerback
idioms. Adopt the more concise fcntl(n, F_GETFL) over fcntl(n, F_GETFL, 0) where it is obvious further investigation will not yield and even better way. Obviousness evaluation and ok guenther@
2015-12-25revert change to call kevent immediately.Ted Unangst
tcpbench (at a minimum) relies on the old behavior of changes all happening after all event handlers run. in particular, it resets the event for the listening socket *before* calling accept(), when it is still readable. kevent then (correctly) says it is readable on the next go through the loop. silly, subtle, and stupid. problem reported by kettenis
2015-12-16change the kqueue backend to call kevent() as events are added insteadTed Unangst
of deferring until the dispatch loop. kqueue support for various types of files and filesystems has been historically incomplete, and kevent handles this condition by returning an error. the libevent dispatch loop has no way to recover from this error and fails catastrophically, bringing down the entire process because one file went bad. now, instead of all that happending, event_add will return an error. the application can choose to handle or ignore this error, but at least the band will play on. ok nicm
2015-12-11Libraries should not print to stderr, ok tedu beck deraadtNicholas Marriott
2015-11-10update NAME section to include all documented functions,Jason McIntyre
or otherwise change Dt to reflect the name of an existing function; feedback/ok schwarze
2015-04-14Another couple of commas in the wrong place, ok jmcNicholas Marriott
2015-04-14Remove an extra comma pointed out by jmc@.Nicholas Marriott
2015-04-14Reorder prototypes to better match manpage layout and add some missingNicholas Marriott
argument names, from Fabian Raetz. ok deraadt
2015-02-05Include stdint.h, not limits.h to get SIZE_MAX. OK guenther@Todd C. Miller
2015-01-06Backout revision 1.37. Setting ev->ev_pncalls to NULL results inAlexander Bluhm
a use after free if the callback has freed the ev. With F in malloc.conf both tmux and the regression tests triggered a segmentation fault. OK nicm@
2015-01-06Apply commit e0e6958aa074a7714cd7c4aa779a1dfede3a03b1 from upstream.Alexander Bluhm
- Avoid deadlock when activating signals. Fixes bug 3048812. Based on patch by Nicholas Marriott. The deadlock was ultimately fixed in a different way (by disabling reinit - see event.c r1.25). Add it now for consistency but without the Windows compatibility code. Convert the fnctl() calls to SOCK_CLOEXEC | SOCK_NONBLOCK to simplify the code. OK nicm@
2015-01-06Apply commit 2d8cf0b720cdd5f9f292f174a10ff74e62a380ec from upstream.Alexander Bluhm
- Defensive programming to prevent (hopefully impossible) stack-stomping OK nicm@
2015-01-05Fix CVE-2014-6272 in Libevent 1.4 from upstream:Alexander Bluhm
- https://github.com/libevent/libevent/commit/7b21c4eabf1f3946d3f63cce1319c490caab8ecf - For this fix, we need to make sure that passing too-large inputs to the evbuffer functions can't make us do bad things with the heap. On top of that do: - Update libevent version to 1.4.15-stable. - Use SIZE_MAX from limits.h instead of a private define. - Do not declare 'size_t need' twice to avoid a compiler warning. OK sthen