summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Richey <joerichey@google.com>2019-07-10 18:01:41 -0700
committerJoe Richey <joerichey@google.com>2019-07-10 18:04:48 -0700
commit956ba427538edb63338aaaffe8372379459ac431 (patch)
treee9a7e40b64eeca071691f90f97db8e2c4cba1a9c
parentb7a27b5c7c9a0962d114b3330f68d06eb2fc7fec (diff)
downloadrust-libc-956ba427538edb63338aaaffe8372379459ac431.tar.gz
dragonfly: Add errno behind libc_thread_local
-rw-r--r--src/unix/bsd/freebsdlike/dragonfly/mod.rs9
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/mod.rs2
-rw-r--r--src/unix/bsd/freebsdlike/mod.rs2
3 files changed, 11 insertions, 2 deletions
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index 3088b2dccd..d1e0a473ab 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -1036,9 +1036,18 @@ f! {
(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) +
_CMSG_ALIGN(length as usize)) as ::c_uint
}
+
+ #[cfg(libc_thread_local)]
+ pub fn __error() -> *mut ::c_int {
+ &mut errno
+ }
}
extern {
+ #[cfg(libc_thread_local)]
+ #[thread_local]
+ static mut errno: ::c_int;
+
pub fn setgrent();
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
-> ::c_int;
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 2fe755d9d1..9f11c202bb 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -1132,6 +1132,8 @@ f! {
}
extern {
+ pub fn __error() -> *mut ::c_int;
+
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs
index 38dd8d05fe..ce5452062c 100644
--- a/src/unix/bsd/freebsdlike/mod.rs
+++ b/src/unix/bsd/freebsdlike/mod.rs
@@ -1098,8 +1098,6 @@ f! {
}
extern {
- pub fn __error() -> *mut ::c_int;
-
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
pub fn sem_init(sem: *mut sem_t,
pshared: ::c_int,