File tree 2 files changed +26
-0
lines changed
src/unix/bsd/freebsdlike/freebsd
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -2164,6 +2164,15 @@ fn test_freebsd(target: &str) {
2164
2164
2165
2165
// Added in FreeBSD 14.
2166
2166
"F_KINFO" => true , // FIXME: depends how frequent freebsd 14 is updated on CI, this addition went this week only.
2167
+ "SHM_RENAME_NOREPLACE"
2168
+ | "SHM_RENAME_EXCHANGE"
2169
+ | "MFD_CLOEXEC"
2170
+ | "MFD_ALLOW_SEALING"
2171
+ | "MFD_HUGETLB"
2172
+ if Some ( 13 ) == freebsd_ver =>
2173
+ {
2174
+ true
2175
+ }
2167
2176
2168
2177
_ => false ,
2169
2178
}
@@ -2205,6 +2214,9 @@ fn test_freebsd(target: &str) {
2205
2214
// `sockcred2` is not available in FreeBSD 12.
2206
2215
"sockcred2" if Some ( 13 ) > freebsd_ver => true ,
2207
2216
2217
+ // Those are not available in FreeBSD 12.
2218
+ "memfd_create" | "shm_rename" if Some ( 13 ) > freebsd_ver => true ,
2219
+
2208
2220
_ => false ,
2209
2221
}
2210
2222
} ) ;
Original file line number Diff line number Diff line change @@ -3615,6 +3615,13 @@ pub const DST_CAN: ::c_int = 6;
3615
3615
pub const CPUCLOCK_WHICH_PID : :: c_int = 0 ;
3616
3616
pub const CPUCLOCK_WHICH_TID : :: c_int = 1 ;
3617
3617
3618
+ pub const MFD_CLOEXEC : :: c_uint = 0x00000001 ;
3619
+ pub const MFD_ALLOW_SEALING : :: c_uint = 0x00000002 ;
3620
+ pub const MFD_HUGETLB : :: c_uint = 0x00000004 ;
3621
+
3622
+ pub const SHM_RENAME_NOREPLACE : :: c_int = 1 << 0 ;
3623
+ pub const SHM_RENAME_EXCHANGE : :: c_int = 1 << 1 ;
3624
+
3618
3625
const_fn ! {
3619
3626
{ const } fn _ALIGN( p: usize ) -> usize {
3620
3627
( p + _ALIGNBYTES) & !_ALIGNBYTES
@@ -4155,6 +4162,13 @@ extern "C" {
4155
4162
4156
4163
pub fn adjtime ( arg1 : * const :: timeval , arg2 : * mut :: timeval ) -> :: c_int ;
4157
4164
pub fn clock_getcpuclockid2 ( arg1 : :: id_t , arg2 : :: c_int , arg3 : * mut clockid_t ) -> :: c_int ;
4165
+
4166
+ pub fn shm_rename (
4167
+ path_from : * const :: c_char ,
4168
+ path_to : * const :: c_char ,
4169
+ flags : :: c_int ,
4170
+ ) -> :: c_int ;
4171
+ pub fn memfd_create ( name : * const :: c_char , flags : :: c_uint ) -> :: c_int ;
4158
4172
}
4159
4173
4160
4174
#[ link( name = "kvm" ) ]
You can’t perform that action at this time.
0 commit comments