]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: fd: implement an optimised my_closefrom() function
authorWilly Tarreau <w@1wt.eu>
Thu, 21 Feb 2019 21:12:47 +0000 (22:12 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 21 Feb 2019 22:07:24 +0000 (23:07 +0100)
commit9188ac60eb8884f273c41849d205bb0df2a12e48
treed2b280e8f4bc64307c07b22463ddc725caf29838
parent2555ccf4d08e5cab6756690753eb08ac0761facd
MINOR: fd: implement an optimised my_closefrom() function

The idea is that poll() can set the POLLNVAL flag for each invalid
FD in a pollfd list. Thus this function makes use of poll() when
compiled in, and builds lists of up to 1024 FDs at once, checks the
output and only closes those which do not have this flag set. Tests
show that this is about twice as fast as blindly calling close() for
each closed fd.
src/fd.c