Skip to content

Commit c354c21

Browse files
committed
Dragonfly: expose __errno_location() rather than define __error().
Expose __errno_location() (introduced in DragonFlyBSD 5.8), which returns the current thread's errno value. This is similar to Linux and avoids having a separate module that defines both errno (which depends on the thread_local feature) and an __error() function.
1 parent 675352e commit c354c21

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

src/unix/bsd/freebsdlike/dragonfly/errno.rs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/unix/bsd/freebsdlike/dragonfly/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,7 @@ f! {
10441044
}
10451045

10461046
extern "C" {
1047+
pub fn __errno_location() -> *mut ::c_int;
10471048
pub fn setgrent();
10481049
pub fn mprotect(
10491050
addr: *mut ::c_void,
@@ -1077,10 +1078,3 @@ extern "C" {
10771078
needlelen: ::size_t,
10781079
) -> *mut ::c_void;
10791080
}
1080-
1081-
cfg_if! {
1082-
if #[cfg(libc_thread_local)] {
1083-
mod errno;
1084-
pub use self::errno::*;
1085-
}
1086-
}

0 commit comments

Comments
 (0)