Skip to content

Commit 6ed3a53

Browse files
authored
Use __errno_location on DragonFly BSD (#82)
DragonFly BSD 5.8+ has __errno_location. DragonFlyBSD/DragonFlyBSD@60d3113
1 parent 70d3d0f commit 6ed3a53

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ features = [
2222
"Win32_System_Diagnostics_Debug",
2323
]
2424

25-
[target.'cfg(target_os="dragonfly")'.dependencies]
26-
errno-dragonfly = "0.1.2"
27-
2825
[target.'cfg(target_os="wasi")'.dependencies]
2926
libc = { version = "0.2", default-features = false }
3027

src/unix.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
// except according to those terms.
1414

1515
use core::str;
16-
#[cfg(target_os = "dragonfly")]
17-
use errno_dragonfly::errno_location;
1816
use libc::{self, c_char, c_int, size_t, strlen};
1917

2018
use crate::Errno;
@@ -57,7 +55,6 @@ pub fn set_errno(Errno(errno): Errno) {
5755
}
5856

5957
extern "C" {
60-
#[cfg(not(target_os = "dragonfly"))]
6158
#[cfg_attr(
6259
any(target_os = "macos", target_os = "ios", target_os = "freebsd"),
6360
link_name = "__error"
@@ -78,7 +75,12 @@ extern "C" {
7875
)]
7976
#[cfg_attr(target_os = "haiku", link_name = "_errnop")]
8077
#[cfg_attr(
81-
any(target_os = "linux", target_os = "hurd", target_os = "redox"),
78+
any(
79+
target_os = "linux",
80+
target_os = "hurd",
81+
target_os = "redox",
82+
target_os = "dragonfly"
83+
),
8284
link_name = "__errno_location"
8385
)]
8486
#[cfg_attr(target_os = "aix", link_name = "_Errno")]

0 commit comments

Comments
 (0)