bpo-40423: Optimization: use close_range(2) if available by kevans91 · Pull Request #22651 · python/cpython

added 2 commits

October 11, 2020 14:01

@blurb-it

pablogsal

@kevans91

pablogsal

cemeyer

xzy3 pushed a commit to xzy3/cpython that referenced this pull request

Oct 18, 2020
)

close_range(2) should be preferred at all times if it's available, otherwise we'll use closefrom(2) if available with a fallback to fdwalk(3) or plain old loop over fd range in order of most efficient to least.

[note that this version does check for ENOSYS, but currently ignores all other errors]

Automerge-Triggered-By: @pablogsal

adorilson pushed a commit to adorilson/cpython that referenced this pull request

Mar 13, 2021
)

close_range(2) should be preferred at all times if it's available, otherwise we'll use closefrom(2) if available with a fallback to fdwalk(3) or plain old loop over fd range in order of most efficient to least.

[note that this version does check for ENOSYS, but currently ignores all other errors]

Automerge-Triggered-By: @pablogsal