diff options
Diffstat (limited to 'src/unix/bsd/freebsdlike/dragonfly/errno.rs')
-rw-r--r-- | src/unix/bsd/freebsdlike/dragonfly/errno.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/unix/bsd/freebsdlike/dragonfly/errno.rs b/src/unix/bsd/freebsdlike/dragonfly/errno.rs new file mode 100644 index 00000000..e9ad63b8 --- /dev/null +++ b/src/unix/bsd/freebsdlike/dragonfly/errno.rs @@ -0,0 +1,12 @@ +// DragonFlyBSD's __error function is declared with "static inline", so it must +// be implemented in the libc crate, as a pointer to a static thread_local. +f! { + pub fn __error() -> *mut ::c_int { + &mut errno + } +} + +extern "C" { + #[thread_local] + pub static mut errno: ::c_int; +} |