MCPcopy Index your code
hub / github.com/RustPython/RustPython / select

Function select

crates/stdlib/src/select.rs:174–199  ·  view source on GitHub ↗
(
    nfds: libc::c_int,
    readfds: &mut FdSet,
    writefds: &mut FdSet,
    errfds: &mut FdSet,
    timeout: Option<&mut timeval>,
)

Source from the content-addressed store, hash-verified

172}
173
174pub fn select(
175 nfds: libc::c_int,
176 readfds: &mut FdSet,
177 writefds: &mut FdSet,
178 errfds: &mut FdSet,
179 timeout: Option<&mut timeval>,
180) -> io::Result<i32> {
181 let timeout = match timeout {
182 Some(tv) => tv as *mut timeval,
183 None => core::ptr::null_mut(),
184 };
185 let ret = unsafe {
186 platform::select(
187 nfds,
188 readfds.0.as_mut_ptr(),
189 writefds.0.as_mut_ptr(),
190 errfds.0.as_mut_ptr(),
191 timeout,
192 )
193 };
194 if platform::check_err(ret) {
195 Err(io::Error::last_os_error())
196 } else {
197 Ok(ret)
198 }
199}
200
201fn sec_to_timeval(sec: f64) -> timeval {
202 timeval {

Callers 3

_copyFunction · 0.90
sock_selectFunction · 0.70
sem_timedwait_polledFunction · 0.70

Calls 15

check_errFunction · 0.85
newFunction · 0.85
as_mut_ptrMethod · 0.80
try_to_valueMethod · 0.80
new_listMethod · 0.80
highestMethod · 0.80
allow_threadsMethod · 0.80
check_signalsMethod · 0.80
collectMethod · 0.80
ErrClass · 0.50
timeFunction · 0.50
mapMethod · 0.45

Tested by

no test coverage detected