File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
src/unix/bsd/freebsdlike/freebsd Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,11 @@ CMSG_LEN
163163CMSG_NXTHDR
164164CMSG_SPACE
165165CODESET
166+ CPU_CLR
167+ CPU_COUNT
168+ CPU_ISSET
169+ CPU_SET
170+ CPU_ZERO
166171CRNCYSTR
167172CRTSCTS
168173CRTS_IFLOW
Original file line number Diff line number Diff line change @@ -3711,6 +3711,17 @@ f! {
37113711 0 != cpuset. __bits[ idx] & ( 1 << offset)
37123712 }
37133713
3714+ pub fn CPU_COUNT ( cpuset: & cpuset_t) -> :: c_int {
3715+ let mut s: u32 = 0 ;
3716+ let cpuset_size = :: mem:: size_of:: <cpuset_t>( ) ;
3717+ let bitset_bits = :: mem:: size_of:: <:: c_long>( ) ;
3718+
3719+ for i in cpuset. __bits[ ..( cpuset_size / bitset_bits) ] . iter( ) {
3720+ s += i. count_ones( ) ;
3721+ } ;
3722+ s as :: c_int
3723+ }
3724+
37143725 pub fn SOCKCRED2SIZE ( ngrps: usize ) -> usize {
37153726 let ngrps = if ngrps > 0 {
37163727 ngrps - 1
You can’t perform that action at this time.
0 commit comments