Skip to content

Commit ac5223a

Browse files
committed
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.
2 parents 106b57a + 694e371 commit ac5223a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

libc-test/semver/freebsd.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,13 @@ SO_REUSEPORT
11401140
SO_REUSEPORT_LB
11411141
SO_SETFIB
11421142
SO_TIMESTAMP
1143+
SO_TS_CLOCK
1144+
SO_TS_REALTIME_MICRO
1145+
SO_TS_BINTIME
1146+
SO_TS_REALTIME
1147+
SO_TS_MONOTONIC
1148+
SO_TS_DEFAULT
1149+
SO_TS_CLOCK_MAX
11431150
SO_USELOOPBACK
11441151
SO_USER_COOKIE
11451152
SO_VENDOR

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2313,9 +2313,17 @@ pub const SO_SETFIB: ::c_int = 0x1014;
23132313
pub const SO_USER_COOKIE: ::c_int = 0x1015;
23142314
pub const SO_PROTOCOL: ::c_int = 0x1016;
23152315
pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL;
2316+
pub const SO_TS_CLOCK: ::c_int = 0x1017;
23162317
pub const SO_DOMAIN: ::c_int = 0x1019;
23172318
pub const SO_VENDOR: ::c_int = 0x80000000;
23182319

2320+
pub const SO_TS_REALTIME_MICRO: ::c_int = 0;
2321+
pub const SO_TS_BINTIME: ::c_int = 1;
2322+
pub const SO_TS_REALTIME: ::c_int = 2;
2323+
pub const SO_TS_MONOTONIC: ::c_int = 3;
2324+
pub const SO_TS_DEFAULT: ::c_int = SO_TS_REALTIME_MICRO;
2325+
pub const SO_TS_CLOCK_MAX: ::c_int = SO_TS_MONOTONIC;
2326+
23192327
pub const LOCAL_CREDS: ::c_int = 2;
23202328
pub const LOCAL_CREDS_PERSISTENT: ::c_int = 3;
23212329
pub const LOCAL_CONNWAIT: ::c_int = 4;

0 commit comments

Comments
 (0)