Skip to content

Releases: cptpcrd/close_fds

v0.3.2

05 Jun 20:40
Compare
Choose a tag to compare
  • perf: use close_range(..., CLOSE_RANGE_CLOEXEC) more in set_fds_cloexec() on Linux
  • refactor: improve close_range() presence check on FreeBSD
  • feat: read /dev/fd on iOS, just like on macOS
  • Add basic example of use with a Command
  • perf: on Linux, cache whether we're running on WSL 1
  • perf: improve performance of slow loop fallback
  • feat: add new "builders" to further customize behavior
  • fix: correct getdents() link name on NetBSD
  • Major internal refactors
  • Improved tests and documentation

v0.3.1

26 Feb 12:54
Compare
Choose a tag to compare

Changelog:

  • feat: Add support for listing /proc/self/fd on NetBSD
  • feat: Add support for using close_range() on Linux 5.9+
  • feat: Add support for using CLOSE_RANGE_CLOEXEC on Linux 5.11+
  • feat: Add support for using close_range() on FreeBSD 12.2+

v0.3.0

03 Jan 17:02
Compare
Choose a tag to compare

Changelog:

  • refactor: add "thread-safe" versions of certain functions
  • perf(close): add translation step to simplify minfd/keep_fds specification
  • perf(fditer): override FdIter::min() and Fditer::max() for efficiency
  • ci: build for more supported targets
  • feat(fditer): expose "possible" status of an FdIter
  • fix: fix internal bugs
  • refactor: major internal refactoring
  • doc: improved documentation (and warnings)
  • test: improved tests

v0.2.2

13 Sep 21:34
Compare
Choose a tag to compare

Changelog

  • Remove Windows support
    • It unnecessarily complicates portions of the code, especially the testing code.
    • It may require users to set an "invalid parameter handler" for it to work properly. Most probably won't realize this and will be confused to see their programs segfault.
    • The real killer: Windows handles file descriptors differently, and a function that closes all file descriptors just isn't necessary for security on Windows.
      The way I understand it, only file descriptors 0, 1, and 2 are ever inherited across program launches. File handles are inherited by default, but we can't close them.
  • Implement size_hint() for FdIter
  • Add warnings to the docs of iter_open_fds() and iter_possible_fds()
  • Add Solaris/Illumos support
  • Ensure FdIter is fused and mark it as such
  • Minor internal refactoring

v0.2.1

27 Aug 14:53
Compare
Choose a tag to compare

CHANGELOG:

  • Add new (Unix-only) set_fds_cloexec() helper
  • FreeBSD: Don't use the kern.proc.nfds sysctl from close_open_fds() (since closefrom() can be used to provide a performance boost on the BSDs, and kern.proc.nfds may actually slow that down)
  • Internal reorganization
  • Improved documentation

v0.2.0

17 Aug 12:54
Compare
Choose a tag to compare

Changelog

  • Improve efficiency of close_open_fds() if keep_fds is sorted
  • Add Windows support (closes file descriptors only, not file handles)
  • Disable /proc/self/fd check on WSL 1, where it's broken (it works on WSL 2)
  • Open all file descriptors as O_CLOEXEC (just in case)
  • Make tests stricter

v0.1.0

17 Aug 12:44
Compare
Choose a tag to compare

Initial release