summaryrefslogtreecommitdiff
path: root/src/unix/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/unix/mod.rs')
-rw-r--r--src/unix/mod.rs25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index 49c2d5717a..b005970b9d 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -130,7 +130,7 @@ s! {
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
__pad14: u32,
- #[cfg(any(target_env = "musl", target_os = "emscripten"))]
+ #[cfg(any(target_env = "musl", target_env = "ohos", target_os = "emscripten"))]
__reserved: [c_long; 16],
}
@@ -351,7 +351,7 @@ cfg_if! {
#[link(name = "dl", cfg(not(target_feature = "crt-static")))]
#[link(name = "c", cfg(not(target_feature = "crt-static")))]
extern {}
- } else if #[cfg(target_env = "musl")] {
+ } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
#[cfg_attr(feature = "rustc-dep-of-std",
link(name = "c", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static")))]
@@ -1217,7 +1217,10 @@ extern "C" {
pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char;
#[cfg_attr(
any(
- all(target_os = "linux", not(target_env = "musl")),
+ all(
+ target_os = "linux",
+ not(any(target_env = "musl", target_env = "ohos"))
+ ),
target_os = "freebsd",
target_os = "dragonfly",
target_os = "haiku"
@@ -1236,11 +1239,11 @@ extern "C" {
pub fn res_init() -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")]
- #[cfg_attr(target_env = "musl", allow(deprecated))]
+ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
// FIXME: for `time_t`
pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
#[cfg_attr(target_os = "netbsd", link_name = "__localtime_r50")]
- #[cfg_attr(target_env = "musl", allow(deprecated))]
+ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
// FIXME: for `time_t`
pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
#[cfg_attr(
@@ -1248,27 +1251,27 @@ extern "C" {
link_name = "mktime$UNIX2003"
)]
#[cfg_attr(target_os = "netbsd", link_name = "__mktime50")]
- #[cfg_attr(target_env = "musl", allow(deprecated))]
+ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
// FIXME: for `time_t`
pub fn mktime(tm: *mut tm) -> time_t;
#[cfg_attr(target_os = "netbsd", link_name = "__time50")]
- #[cfg_attr(target_env = "musl", allow(deprecated))]
+ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
// FIXME: for `time_t`
pub fn time(time: *mut time_t) -> time_t;
#[cfg_attr(target_os = "netbsd", link_name = "__gmtime50")]
- #[cfg_attr(target_env = "musl", allow(deprecated))]
+ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
// FIXME: for `time_t`
pub fn gmtime(time_p: *const time_t) -> *mut tm;
#[cfg_attr(target_os = "netbsd", link_name = "__locatime50")]
- #[cfg_attr(target_env = "musl", allow(deprecated))]
+ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
// FIXME: for `time_t`
pub fn localtime(time_p: *const time_t) -> *mut tm;
#[cfg_attr(target_os = "netbsd", link_name = "__difftime50")]
- #[cfg_attr(target_env = "musl", allow(deprecated))]
+ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
// FIXME: for `time_t`
pub fn difftime(time1: time_t, time0: time_t) -> ::c_double;
#[cfg_attr(target_os = "netbsd", link_name = "__timegm50")]
- #[cfg_attr(target_env = "musl", allow(deprecated))]
+ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
// FIXME: for `time_t`
pub fn timegm(tm: *mut ::tm) -> time_t;