bytecodealliance / bytecodealliance/rustix

socket/sockopt: kernel timestamping support

Open
#1,469 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
2.1k
Forks
294
Avg merge
4h 7m
Merged PRs (30d)
2

Description

I'm trying to switch away from nix/libc to this crate & I found that rustix currently doesn't provide functions for using kernel timestamping. The `nix` crate provides the following required for kernel timestamping:
- sockopt: [ReceiveTimestamp](https://docs.rs/nix/latest/nix/sys/socket/sockopt/struct.ReceiveTimestamp.html)
- sockopt: [ReceiveTimestampns](https://docs.rs/nix/latest/nix/sys/socket/sockopt/struct.ReceiveTimestampns.html)
- sockopt: [Timestamping](https://docs.rs/nix/latest/nix/sys/socket/sockopt/struct.Timestamping.html)
- sockopt: [TimestampingFlag](https://docs.rs/nix/latest/nix/sys/socket/struct.TimestampingFlag.html) (for `Timestamping`)
- socket: [ControlMessageOwned::ScmTimestamp](https://docs.rs/nix/latest/nix/sys/socket/enum.ControlMessageOwned.html#variant.ScmTimestamp) (for `ReceiveTimestamp`)
- socket: [ControlMessageOwned::ScmTimestampns](https://docs.rs/nix/latest/nix/sys/socket/enum.ControlMessageOwned.html#variant.ScmTimestampns) (for `ReceiveTimestampns`)
- socket: [ControlMessageOwned::ScmTimestampsns](https://docs.rs/nix/latest/nix/sys/socket/enum.ControlMessageOwned.html#variant.ScmTimestampsns) (for `Timestamping`)
- socket: [Timestamps](https://docs.rs/nix/latest/nix/sys/socket/struct.Timestamps.html) (for `Timestamping`)

I'm willing to work on a PR contributing a similar API (with individual functions for each sockopt variant, as is the rustix way).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.