diff options
author | bors <bors@rust-lang.org> | 2023-02-02 18:18:56 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2023-02-02 18:18:56 +0000 |
commit | ac5223a6dc6c8d84fd4c9181c1cf53a0376d39ad (patch) | |
tree | edbe8a2714b31f28ccf4ec964acdc51ebb5440af | |
parent | 106b57a796145c42f9a385a2a8cf764abbc66624 (diff) | |
parent | 694e3710a54483d6d1739040de0d42b370757dbe (diff) | |
download | rust-libc-ac5223a6dc6c8d84fd4c9181c1cf53a0376d39ad.tar.gz |
Auto merge of #3098 - folkertdev:freebsd-timestamp-constants, r=JohnTitor
add SO_TS_* constants for FreeBSD
These constants are used in timestamping of packets on a socket. The definitions come from https://github.com/bminor/newlib/blob/master/newlib/libc/sys/rtems/include/sys/socket.h#L165.
For context, here is an example of some of these being used on FreeBSD for packet timestamping in NTP: https://github.com/ntpsec/ntpsec/blob/master/ntpd/ntp_packetstamp.c.
-rw-r--r-- | libc-test/semver/freebsd.txt | 7 | ||||
-rw-r--r-- | src/unix/bsd/freebsdlike/freebsd/mod.rs | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index a09f45136d..def9315d1d 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -1140,6 +1140,13 @@ SO_REUSEPORT SO_REUSEPORT_LB SO_SETFIB SO_TIMESTAMP +SO_TS_CLOCK +SO_TS_REALTIME_MICRO +SO_TS_BINTIME +SO_TS_REALTIME +SO_TS_MONOTONIC +SO_TS_DEFAULT +SO_TS_CLOCK_MAX SO_USELOOPBACK SO_USER_COOKIE SO_VENDOR diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 27caa93608..0342fb57cf 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -2313,9 +2313,17 @@ pub const SO_SETFIB: ::c_int = 0x1014; pub const SO_USER_COOKIE: ::c_int = 0x1015; pub const SO_PROTOCOL: ::c_int = 0x1016; pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL; +pub const SO_TS_CLOCK: ::c_int = 0x1017; pub const SO_DOMAIN: ::c_int = 0x1019; pub const SO_VENDOR: ::c_int = 0x80000000; +pub const SO_TS_REALTIME_MICRO: ::c_int = 0; +pub const SO_TS_BINTIME: ::c_int = 1; +pub const SO_TS_REALTIME: ::c_int = 2; +pub const SO_TS_MONOTONIC: ::c_int = 3; +pub const SO_TS_DEFAULT: ::c_int = SO_TS_REALTIME_MICRO; +pub const SO_TS_CLOCK_MAX: ::c_int = SO_TS_MONOTONIC; + pub const LOCAL_CREDS: ::c_int = 2; pub const LOCAL_CREDS_PERSISTENT: ::c_int = 3; pub const LOCAL_CONNWAIT: ::c_int = 4; |