commit | 9188ac60eb8884f273c41849d205bb0df2a12e48 | [log] [tgz] |
---|---|---|
author | Willy Tarreau <w@1wt.eu> | Thu Feb 21 22:12:47 2019 +0100 |
committer | Willy Tarreau <w@1wt.eu> | Thu Feb 21 23:07:24 2019 +0100 |
tree | d2b280e8f4bc64307c07b22463ddc725caf29838 | |
parent | 2555ccf4d08e5cab6756690753eb08ac0761facd [diff] |
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.