MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / fd_set_num_elements_for_fd_array_raw

Function fd_set_num_elements_for_fd_array_raw

src/event/select.rs:241–248  ·  view source on GitHub ↗
(set_count: usize)

Source from the content-addressed store, hash-verified

239#[cfg(any(windows, target_os = "wasi"))]
240#[inline]
241fn fd_set_num_elements_for_fd_array_raw(set_count: usize) -> usize {
242 // Allocate space for an `fd_count` field, plus `set_count` elements
243 // for the `fd_array` field.
244 div_ceil(
245 core::cmp::max(align_of::<FD_SET>(), align_of::<RawFd>()) + set_count * size_of::<RawFd>(),
246 size_of::<FdSetElement>(),
247 )
248}
249
250/// `fd_set_num_elements` implementation on platforms with bitvector
251/// implementations.

Callers 1

Calls 1

div_ceilFunction · 0.85

Tested by

no test coverage detected