]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: listener: add support for linux's accept4() syscall
authorWilly Tarreau <w@1wt.eu>
Mon, 8 Oct 2012 18:11:03 +0000 (20:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 8 Oct 2012 18:11:03 +0000 (20:11 +0200)
commit1bc4aab2902d732530ccbd098d30e519aab3abdd
tree195db946d24f6b30e10f40579f277aeb76dd55b2
parent1b6c00cb9942d634263253408c265c96f4f38630
MEDIUM: listener: add support for linux's accept4() syscall

On Linux, accept4() does the same as accept() except that it allows
the caller to specify some flags to set on the resulting socket. We
use this to set the O_NONBLOCK flag and thus to save one fcntl()
call in each connection. The effect is a small performance gain of
around 1%.

The option is automatically enabled when target linux2628 is set, or
when the USE_ACCEPT4 Makefile variable is set. If the libc is too old
to provide the equivalent function, this is automatically detected and
our own function is used instead. In any case it is possible to force
the use of our implementation with USE_MY_ACCEPT4.
Makefile
include/common/accept4.h [new file with mode: 0644]
include/common/syscall.h
src/i386-linux-vsys.c
src/listener.c
src/session.c