nix-rust / nix

Rust friendly bindings to *nix APIs
MIT License
2.57k stars 650 forks source link

refactor: remove EventFd::defuse() and EventFd::arm() #2452

Closed SteveLauC closed 2 weeks ago

SteveLauC commented 2 weeks ago

What does this PR do

  1. Remove EventFd::defuse() because it is a no-op, write(0)ing to an event fd does nothing. While in the documentation, it says:

    a following call to poll, select or epoll will block.

    which means that this method should reset the kernel counter to 0, but it won't.

  2. Remove EventFd::arm() for symmetry reasons.

Having read()/write() is already sufficient for usage.

Closes #2422

Checklist: