Skip to main content

dope_uring/raw/
source.rs

1use dope_sys::kernel;
2
3use crate::Uring;
4
5// SAFETY: read accesses the calling thread's actual native errno slot, preserving
6// the value set by its immediately preceding syscall.
7unsafe impl kernel::raw::Source for Uring {
8    #[inline]
9    fn read() -> i32 {
10        // SAFETY: this native TLS cell is read synchronously on its owning thread.
11        unsafe { libc::__errno_location().read() }
12    }
13}