Skip to content

Commit 956ba42

Browse files
committed
dragonfly: Add errno behind libc_thread_local
1 parent b7a27b5 commit 956ba42

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,9 +1036,18 @@ f! {
10361036
(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) +
10371037
_CMSG_ALIGN(length as usize)) as ::c_uint
10381038
}
1039+
1040+
#[cfg(libc_thread_local)]
1041+
pub fn __error() -> *mut ::c_int {
1042+
&mut errno
1043+
}
10391044
}
10401045

10411046
extern {
1047+
#[cfg(libc_thread_local)]
1048+
#[thread_local]
1049+
static mut errno: ::c_int;
1050+
10421051
pub fn setgrent();
10431052
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
10441053
-> ::c_int;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,8 @@ f! {
11321132
}
11331133

11341134
extern {
1135+
pub fn __error() -> *mut ::c_int;
1136+
11351137
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
11361138
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
11371139
pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,8 +1098,6 @@ f! {
10981098
}
10991099

11001100
extern {
1101-
pub fn __error() -> *mut ::c_int;
1102-
11031101
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
11041102
pub fn sem_init(sem: *mut sem_t,
11051103
pshared: ::c_int,

0 commit comments

Comments
 (0)