Skip to content

Commit

Permalink
Fix compilation with target_env=ohos
Browse files Browse the repository at this point in the history
OpenHarmony(alias ohos) is tie 3 supported target for rust.
see rust-lang/compiler-team#568.

In implementation it sits close to musl instead of bionic
and napi instead jni when comparing with android.

Below is copied from ohos sdk:

```
> ag iov_max openharmony/9/native/sysroot/usr/include
openharmony/9/native/sysroot/usr/include/limits.h
50:#define IOV_MAX 1024
162:#define _XOPEN_IOV_MAX          16

openharmony/9/native/sysroot/usr/include/unistd.h
320:#define _SC_IOV_MAX 60
```
  • Loading branch information
Chilledheart committed Jan 28, 2024
1 parent 76cbffb commit 01a5ec4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/sys/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ type IovLen = usize;
target_os = "linux",
any(
target_env = "musl",
target_env = "ohos",
all(target_env = "uclibc", target_pointer_width = "32")
)
),
Expand Down

0 comments on commit 01a5ec4

Please sign in to comment.