rustix icon indicating copy to clipboard operation
rustix copied to clipboard

Pidfd enhancements

Open rusty-snake opened this issue 8 months ago • 4 comments

  • [x] rust-lang/libc#4402
  • [ ] PidfdFlags::THREAD = PIDFD_THREAD
  • [x] pidfd_send_signal (#992) is in rustix::not_implemented::yet and rustix::process (#1448)
  • [ ] PIDFD_SIGNAL_THREAD, PIDFD_SIGNAL_THREAD_GROUP and PIDFD_SIGNAL_PROCESS_GROUP.
    • Because the rustix::process::pidfd_send_signal interface does not expose an (empty) flags argument and adding one would be a breaking change, I suggest to deprecated rustix::process::pidfd_send_signal and add rustix::process::pidfd_send_signal_{thread,thread_group,process_group} variants. This time with an empty flags for the future.
    • On the other hand this could require downstream code to switch between these variants to maybe a rustix::process::pidfd_send_signal_with_flags (name tbd) is also a thing.
      • pidfd_send_signal_to
  • [ ] PIDFD_SELF and PIDFD_SELF_PROCESS descriptors implemented in rustix::process like rustix::fs::CWD is implemented.
  • [ ] PIDFD_GET_*_NAMESPACE ioctls. Either as one function with an non-exhaustive enum argument or as separated for functions for each ioctl.
  • [ ] PIDFD_GET_INFO ioctl, pidfd_info struct, PIDFD_INFO_* bitflags
    • [ ] PIDFD_INFO_EXIT

rusty-snake avatar Apr 11 '25 17:04 rusty-snake

would it be possible to support passing siginfo_t to pidfd_send_signal?

yshui avatar Aug 07 '25 17:08 yshui

What about SO_PEER_FD support? nix supports it and it's very similar to rustix::net::sockopt::socket_peercred. It's super important for the moden Linux userspace (systemd and services/apps above).

zeenix avatar Oct 16 '25 12:10 zeenix

This one #1474?

rusty-snake avatar Oct 16 '25 14:10 rusty-snake

This one #1474?

Ah yes. That's the one. :)

zeenix avatar Oct 16 '25 16:10 zeenix