| ... | ... | @@ -10,6 +10,7 @@ pub const cpuset_t = extern struct { |
| 10 | 10 | __bits: [(CPU_SETSIZE + (@bitSizeOf(c_long) - 1)) / @bitSizeOf(c_long)]c_long, |
| 11 | 11 | }; |
| 12 | 12 | |
| 13 | // TODO: can eventually serve for the domainset_t's type too. |
| 13 | 14 | fn __BIT_COUNT(bits: []const c_long) c_long { |
| 14 | 15 | var count: c_long = 0; |
| 15 | 16 | for (bits) |b| { |
| ... | ... | @@ -2562,18 +2563,8 @@ pub const DOMAINSET = struct { |
| 2562 | 2563 | pub const POLICY_MAX = DOMAINSET.POLICY_INTERLEAVE; |
| 2563 | 2564 | }; |
| 2564 | 2565 | |
| 2565 | | pub const DOMAINSET_SIZE = 256; |
| 2566 | 2566 | pub const domainset_t = extern struct { |
| 2567 | | __bits: [(DOMAINSET_SIZE + (@sizeOf(domainset) - 1)) / @bitSizeOf(domainset)]domainset, |
| 2568 | | }; |
| 2569 | | |
| 2570 | | pub fn DOMAINSET_COUNT(set: domainset_t) c_int { |
| 2571 | | return @as(c_int, @intCast(__BIT_COUNT(set.__bits[0..]))); |
| 2572 | | } |
| 2573 | | |
| 2574 | | pub const domainset = extern struct { |
| 2575 | 2567 | link: LIST_ENTRY, |
| 2576 | | mask: domainset_t, |
| 2577 | 2568 | policy: u16, |
| 2578 | 2569 | prefer: domainid_t, |
| 2579 | 2570 | cnt: domainid_t, |