leitner
45f99bbd0a
in io_eagain, make sure the kernel knows we wanted to write to the
...
descriptor in case we optimized the syscall away previously
in iob_send leave loop if we got a partial write
2021-04-24 11:39:18 +00:00
leitner
f4cd377378
fix out of bounds memory access
2021-04-23 08:02:09 +00:00
leitner
86e596b870
limit iovec size for sendmsg code path to 50
2021-04-22 12:53:53 +00:00
leitner
1fb5505cc2
add missing includes
2021-04-22 11:12:52 +00:00
leitner
b5f21a3900
add support for saving syscalls with accept4
2021-03-12 16:23:32 +00:00
leitner
c4b0dd6b81
move cleanup after check that all events are handled
2021-03-12 10:43:46 +00:00
leitner
15f004df55
prevent infinite loop in cleanup code for
...
io_close-with-outstanding-events-queued race prevention
2021-03-11 14:13:51 +00:00
leitner
5f9f1a2a62
properly initialize deferred list in io_fd (did not help though)
2021-03-09 13:54:59 +00:00
leitner
ad37bd83de
add snarky comment
2021-02-18 23:21:57 +00:00
leitner
d4ac8fe906
might actually work now
2021-02-17 13:48:39 +00:00
leitner
75fe9a620e
attempt to prevent future endless loops in io_wait half-closed fd
...
cleanup
2021-02-16 15:50:38 +00:00
leitner
ddfdd4d077
add compiler.h to abstract gcc attributes
2020-11-08 00:29:35 +00:00
leitner
69c9d1454d
port the epoll optimizations to kqueue, hopefully repairing it in the process
2020-05-15 11:42:53 +00:00
leitner
9d51f000ef
silence another compiler warning
2020-05-14 14:48:40 +00:00
leitner
bbaf63c7fd
remove compiler warnings in ent
...
try to fix io_waituntil2 on freebsd
2020-05-14 14:46:31 +00:00
leitner
8b0450cd29
some old glibc may define MSG_ZEROCOPY but not SO_ZEROCOPY :-(
2020-04-05 20:19:25 +00:00
leitner
278a675a69
bsd fix
2019-02-21 12:43:06 +00:00
leitner
97368fbfa6
BSD build fix (hopefully)
...
move more #include to <libowfat/...>
2019-02-21 12:24:05 +00:00
leitner
3873bab74b
add stralloc_APPEND
...
use atomic updates for iom->working
2018-04-11 14:12:50 +00:00
leitner
ce595ae0cc
add experimental iom API for multithreaded I/O multiplexing (in io.h)
2018-03-27 02:23:00 +00:00
leitner
94feba3667
use write in buffer_put for a slight perf improvement
2018-03-12 13:04:30 +00:00
leitner
e4a2f4d068
compile if MSG_ZEROCOPY is not defined by libc
2017-11-24 17:21:10 +00:00
leitner
f8c4132df0
add MSG_ZEROCOPY support (only used for buffers >8k)
2017-11-15 14:09:26 +00:00
leitner
760598ec2f
#include <foo.h> -> #include <libowfat/foo.h>
2017-05-13 22:51:26 +00:00
leitner
c29096b2e0
some more eagain handling in tryread and trywrite
...
cosmetic change
2017-02-04 17:23:33 +00:00
leitner
d862c9e482
"fmt.h" instead of <fmt.h>
2016-10-15 12:29:00 +00:00
leitner
b4c4eb607e
remove OpenBSD #warning (obsd maintainer says no longer needed)
2016-10-11 11:45:46 +00:00
leitner
2a0bcc2fb6
implement deferred closing
2016-10-04 22:43:31 +00:00
leitner
b73a699dab
reengineer alt queue handling to prevent race
2016-10-04 21:31:14 +00:00
leitner
f9570b38a1
attempt to work around race condition when you close an fd but there are
...
still outstanding events queued on it.
2016-10-04 20:38:04 +00:00
leitner
8913f6174c
document race condition caused by queueing of multiple events
2016-10-01 20:10:38 +00:00
leitner
137b80ea74
test for pread and use it instead of lseek+read in cdb and io_mmapwritefile
2016-06-23 19:42:13 +00:00
leitner
a1f1986247
include <foo> -> include "foo"
2016-03-17 11:13:23 +00:00
leitner
7bdc1b29bb
a few missing headers and minor fixes
...
fix corking behavior for the case where a buffer follows a buffer in
iob_send
2015-09-06 18:01:02 +00:00
leitner
fce165fdcb
remove dead store
2015-04-10 23:15:59 +00:00
leitner
c60c2425ce
hopefully fix the infinite loop in gatling
2014-10-19 01:52:36 +00:00
leitner
193dfba16b
remove compiler warning
2014-10-16 16:17:09 +00:00
leitner
4fa4a524d2
add io_fd_flags so the caller can tell io_fd whether the socket is blocking
...
(saves one fcntl syscall)
2014-10-09 09:02:28 +00:00
leitner
953eb639b2
on Linux, save a few syscalls by using sendto/sendmsg with MSG_MORE
...
instead of write/writev + setsockopt TCP_CORK
2014-10-07 13:43:50 +00:00
leitner
4404ab35f3
revert to level triggering for epoll (forgot io_wantread)
2014-09-09 13:48:04 +00:00
leitner
967e3ce019
revert edge triggering epoll; it had reliability and fairness issues and
...
was also not actually faster
2014-08-28 19:03:57 +00:00
leitner
39e7ee90bb
introduce io_eagain_read and io_eagain_write (discontinue using io_eagain plz)
2014-06-05 20:43:01 +00:00
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
2014-06-05 19:17:24 +00:00
leitner
5baf943f0a
finish epoll move to edge triggering
2014-05-08 04:25:42 +00:00
leitner
a544abc39c
switch io_fds from array to newly implemented (hopefully thread-safe) iarray
...
switch epoll from level triggering to edge triggering
2014-04-04 18:11:03 +00:00
leitner
ff3a3410ec
hopefully this fixes the looping gatling processes
2013-10-01 23:15:51 +00:00
leitner
e175800a8c
add io_fd_canwrite (like io_fd but assume the fd is writable)
...
save a few syscalls here and there
2012-04-10 21:15:51 +00:00
leitner
6e6fc8b85d
fix endless loop bug on freebsd
2012-03-19 02:38:52 +00:00
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
2012-02-24 02:00:52 +00:00
leitner
662cf55fc9
accept -3 as error return from the callback, too
2012-01-20 19:19:49 +00:00