File tree 2 files changed +19
-0
lines changed
src/unix/bsd/freebsdlike/freebsd
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1770,6 +1770,8 @@ fn test_freebsd(target: &str) {
1770
1770
_ => & mut cfg,
1771
1771
} ;
1772
1772
1773
+ // For sched linux compat fn
1774
+ cfg. define ( "_WITH_CPU_SET_T" , None ) ;
1773
1775
// Required for `getline`:
1774
1776
cfg. define ( "_WITH_GETLINE" , None ) ;
1775
1777
// Required for making freebsd11_stat available in the headers
@@ -2224,6 +2226,13 @@ fn test_freebsd(target: &str) {
2224
2226
// https://github.com/gnzlbg/ctest/issues/68
2225
2227
"lio_listio" => true ,
2226
2228
2229
+ // Those are introduced in FreeBSD 14.
2230
+ "sched_getaffinity" | "sched_setaffinity" | "sched_getcpu"
2231
+ if Some ( 14 ) > freebsd_ver =>
2232
+ {
2233
+ true
2234
+ }
2235
+
2227
2236
_ => false ,
2228
2237
}
2229
2238
} ) ;
Original file line number Diff line number Diff line change @@ -3976,6 +3976,16 @@ extern "C" {
3976
3976
cpusetp : * const cpuset_t ,
3977
3977
) -> :: c_int ;
3978
3978
3979
+ // sched.h linux compatibility api
3980
+ pub fn sched_getaffinity ( pid : :: pid_t , cpusetsz : :: size_t , cpuset : * mut :: cpuset_t ) -> :: c_int ;
3981
+ // FIXME: the first argument's type might not be correct, fix later if that changes.
3982
+ pub fn sched_setaffinity (
3983
+ pid : :: c_int ,
3984
+ cpusetsz : :: size_t ,
3985
+ cpuset : * const :: cpuset_t ,
3986
+ ) -> :: c_int ;
3987
+ pub fn sched_getcpu ( ) -> :: c_int ;
3988
+
3979
3989
pub fn pthread_mutex_consistent ( mutex : * mut :: pthread_mutex_t ) -> :: c_int ;
3980
3990
3981
3991
pub fn pthread_mutexattr_getrobust (
You can’t perform that action at this time.
0 commit comments