Commit Graph

202 Commits (1fb5505cc2903561a6b89123725acc013bb71694)

Author SHA1 Message Date
leitner 1fb5505cc2 add missing includes
leitner b5f21a3900 add support for saving syscalls with accept4
leitner c4b0dd6b81 move cleanup after check that all events are handled
leitner 15f004df55 prevent infinite loop in cleanup code for
io_close-with-outstanding-events-queued race prevention
leitner 5f9f1a2a62 properly initialize deferred list in io_fd (did not help though)
leitner ad37bd83de add snarky comment
leitner d4ac8fe906 might actually work now
leitner 75fe9a620e attempt to prevent future endless loops in io_wait half-closed fd
cleanup
leitner ddfdd4d077 add compiler.h to abstract gcc attributes
leitner 69c9d1454d port the epoll optimizations to kqueue, hopefully repairing it in the process
leitner 9d51f000ef silence another compiler warning
leitner bbaf63c7fd remove compiler warnings in ent
try to fix io_waituntil2 on freebsd
leitner 8b0450cd29 some old glibc may define MSG_ZEROCOPY but not SO_ZEROCOPY :-(
leitner 278a675a69 bsd fix
leitner 97368fbfa6 BSD build fix (hopefully)
move more #include to <libowfat/...>
leitner 3873bab74b add stralloc_APPEND
use atomic updates for iom->working
leitner ce595ae0cc add experimental iom API for multithreaded I/O multiplexing (in io.h)
leitner 94feba3667 use write in buffer_put for a slight perf improvement
leitner e4a2f4d068 compile if MSG_ZEROCOPY is not defined by libc
leitner f8c4132df0 add MSG_ZEROCOPY support (only used for buffers >8k)
leitner 760598ec2f #include <foo.h> -> #include <libowfat/foo.h>
leitner c29096b2e0 some more eagain handling in tryread and trywrite
cosmetic change
leitner d862c9e482 "fmt.h" instead of <fmt.h>
leitner b4c4eb607e remove OpenBSD #warning (obsd maintainer says no longer needed)
leitner 2a0bcc2fb6 implement deferred closing
leitner b73a699dab reengineer alt queue handling to prevent race
leitner f9570b38a1 attempt to work around race condition when you close an fd but there are
still outstanding events queued on it.
leitner 8913f6174c document race condition caused by queueing of multiple events
leitner 137b80ea74 test for pread and use it instead of lseek+read in cdb and io_mmapwritefile
leitner a1f1986247 include <foo> -> include "foo"
leitner 7bdc1b29bb a few missing headers and minor fixes
fix corking behavior for the case where a buffer follows a buffer in
iob_send
leitner fce165fdcb remove dead store
leitner c60c2425ce hopefully fix the infinite loop in gatling
leitner 193dfba16b remove compiler warning
leitner 4fa4a524d2 add io_fd_flags so the caller can tell io_fd whether the socket is blocking
(saves one fcntl syscall)
leitner 953eb639b2 on Linux, save a few syscalls by using sendto/sendmsg with MSG_MORE
instead of write/writev + setsockopt TCP_CORK
leitner 4404ab35f3 revert to level triggering for epoll (forgot io_wantread)
leitner 967e3ce019 revert edge triggering epoll; it had reliability and fairness issues and
was also not actually faster
leitner 39e7ee90bb introduce io_eagain_read and io_eagain_write (discontinue using io_eagain plz)
leitner d9cbb3940c it turns out you don't need -1/EGAIN to know edge triggering told you
there is no more data, it's enough to read/write less than you asked for
leitner 5baf943f0a finish epoll move to edge triggering
leitner a544abc39c switch io_fds from array to newly implemented (hopefully thread-safe) iarray
switch epoll from level triggering to edge triggering
leitner ff3a3410ec hopefully this fixes the looping gatling processes
leitner e175800a8c add io_fd_canwrite (like io_fd but assume the fd is writable)
save a few syscalls here and there
leitner 6e6fc8b85d fix endless loop bug on freebsd
leitner c2a2a15c12 document the return value expected from the callback given to iob_write
remove unused #include in iob_reset
if iob_addfile_close fails, it now closes the fd
if iob_addbuf_munmap fails, it now munmaps the buf
if iob_addbuf_free fails, it now frees the buf
some win32 cross-compile fixes for iarray
leitner 662cf55fc9 accept -3 as error return from the callback, too
leitner b0886bc324 the iob calls return int, not void
leitner d2aae4864c only try to receive one byte to avoid discarding data
leitner 3bed09a972 get rid of warning