Skip to content

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

libc-test/build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2781,6 +2781,9 @@ fn test_freebsd(target: &str) {
27812781
// FIXME(freebsd): Removed in FreeBSD 15, deprecated in libc
27822782
"TCP_PCAP_OUT" | "TCP_PCAP_IN" => true,
27832783

2784+
// Added in FreeBSD 14.2
2785+
"SO_SPLICE" if Some(14) > freebsd_ver => true,
2786+
27842787
_ => false,
27852788
}
27862789
});
@@ -2832,6 +2835,9 @@ fn test_freebsd(target: &str) {
28322835
// FIXME(freebsd): Changed in FreeBSD 15
28332836
"tcp_info" | "sockstat" if Some(15) >= freebsd_ver => true,
28342837

2838+
// `splice` introduced in FreeBSD 14.2
2839+
"splice" if Some(14) > freebsd_ver => true,
2840+
28352841
_ => false,
28362842
}
28372843
});

libc-test/semver/freebsd.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,7 @@ SO_PROTOTYPE
14601460
SO_REUSEPORT
14611461
SO_REUSEPORT_LB
14621462
SO_SETFIB
1463+
SO_SPLICE
14631464
SO_TIMESTAMP
14641465
SO_TS_BINTIME
14651466
SO_TS_CLOCK
@@ -2353,6 +2354,7 @@ sigwait
23532354
sigwaitinfo
23542355
sockaddr_dl
23552356
sockcred
2357+
splice
23562358
srand
23572359
srand48
23582360
stack_t

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,12 @@ s! {
13961396
tqh_first: *mut c_void,
13971397
tqh_last: *mut *mut c_void,
13981398
}
1399+
1400+
pub struct splice {
1401+
pub sp_fd: c_int,
1402+
pub sp_max: off_t,
1403+
pub sp_idle: crate::timeval,
1404+
}
13991405
}
14001406

14011407
s_no_extra_traits! {
@@ -3186,6 +3192,7 @@ pub const SO_PROTOCOL: c_int = 0x1016;
31863192
pub const SO_PROTOTYPE: c_int = SO_PROTOCOL;
31873193
pub const SO_TS_CLOCK: c_int = 0x1017;
31883194
pub const SO_DOMAIN: c_int = 0x1019;
3195+
pub const SO_SPLICE: c_int = 0x1023;
31893196
pub const SO_VENDOR: c_int = 0x80000000;
31903197

31913198
pub const SO_TS_REALTIME_MICRO: c_int = 0;

0 commit comments

Comments
 (0)