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

Function convert

src/backend/linux_raw/event/syscalls.rs:36–41  ·  view source on GitHub ↗

If we don't have a timeout, or if we can convert the timeout to a `__kernel_old_timespec`, the use `__NR_ppoll`.

(timeout: &Timespec)

Source from the content-addressed store, hash-verified

34 // If we don't have a timeout, or if we can convert the timeout to
35 // a `__kernel_old_timespec`, the use `__NR_ppoll`.
36 fn convert(timeout: &Timespec) -> Option<__kernel_old_timespec> {
37 Some(__kernel_old_timespec {
38 tv_sec: timeout.tv_sec.try_into().ok()?,
39 tv_nsec: timeout.tv_nsec.try_into().ok()?,
40 })
41 }
42 let old_timeout = if let Some(timeout) = timeout {
43 match convert(timeout) {
44 // Could not convert timeout.

Callers 2

pollFunction · 0.70
selectFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected