471471 __pgrp: :: pid_t,
472472 __sd: :: sigset_t,
473473 __ss: :: sigset_t,
474- #[ cfg( target_env = "musl" ) ]
474+ #[ cfg( any ( target_env = "musl" , target_env = "ohos" ) ) ]
475475 __prio: :: c_int,
476- #[ cfg( not( target_env = "musl" ) ) ]
476+ #[ cfg( not( any ( target_env = "musl" , target_env = "ohos" ) ) ) ]
477477 __sp: :: sched_param,
478478 __policy: :: c_int,
479479 __pad: [ :: c_int; 16 ] ,
@@ -1225,7 +1225,7 @@ cfg_if! {
12251225}
12261226
12271227cfg_if ! {
1228- if #[ cfg( any( target_env = "gnu" , target_env = "musl" ) ) ] {
1228+ if #[ cfg( any( target_env = "gnu" , target_env = "musl" , target_env = "ohos" ) ) ] {
12291229 pub const ABDAY_1 : :: nl_item = 0x20000 ;
12301230 pub const ABDAY_2 : :: nl_item = 0x20001 ;
12311231 pub const ABDAY_3 : :: nl_item = 0x20002 ;
@@ -3972,17 +3972,25 @@ safe_f! {
39723972cfg_if ! {
39733973 if #[ cfg( not( target_env = "uclibc" ) ) ] {
39743974 extern "C" {
3975+ #[ cfg( not( target_env = "ohos" ) ) ]
39753976 pub fn aio_read( aiocbp: * mut aiocb) -> :: c_int;
3977+ #[ cfg( not( target_env = "ohos" ) ) ]
39763978 pub fn aio_write( aiocbp: * mut aiocb) -> :: c_int;
3979+ #[ cfg( not( target_env = "ohos" ) ) ]
39773980 pub fn aio_fsync( op: :: c_int, aiocbp: * mut aiocb) -> :: c_int;
3981+ #[ cfg( not( target_env = "ohos" ) ) ]
39783982 pub fn aio_error( aiocbp: * const aiocb) -> :: c_int;
3983+ #[ cfg( not( target_env = "ohos" ) ) ]
39793984 pub fn aio_return( aiocbp: * mut aiocb) -> :: ssize_t;
3985+ #[ cfg( not( target_env = "ohos" ) ) ]
39803986 pub fn aio_suspend(
39813987 aiocb_list: * const * const aiocb,
39823988 nitems: :: c_int,
39833989 timeout: * const :: timespec,
39843990 ) -> :: c_int;
3991+ #[ cfg( not( target_env = "ohos" ) ) ]
39853992 pub fn aio_cancel( fd: :: c_int, aiocbp: * mut aiocb) -> :: c_int;
3993+ #[ cfg( not( target_env = "ohos" ) ) ]
39863994 pub fn lio_listio(
39873995 mode: :: c_int,
39883996 aiocb_list: * const * mut aiocb,
@@ -4039,7 +4047,10 @@ cfg_if! {
40394047}
40404048
40414049extern "C" {
4042- #[ cfg_attr( not( target_env = "musl" ) , link_name = "__xpg_strerror_r" ) ]
4050+ #[ cfg_attr(
4051+ not( any( target_env = "musl" , target_env = "ohos" ) ) ,
4052+ link_name = "__xpg_strerror_r"
4053+ ) ]
40434054 pub fn strerror_r ( errnum : :: c_int , buf : * mut c_char , buflen : :: size_t ) -> :: c_int ;
40444055
40454056 pub fn abs ( i : :: c_int ) -> :: c_int ;
@@ -4073,6 +4084,7 @@ extern "C" {
40734084 // Only `getspnam_r` is implemented for musl, out of all of the reenterant
40744085 // functions from `shadow.h`.
40754086 // https://git.musl-libc.org/cgit/musl/tree/include/shadow.h
4087+ #[ cfg( not( target_env = "ohos" ) ) ]
40764088 pub fn getspnam_r (
40774089 name : * const :: c_char ,
40784090 spbuf : * mut spwd ,
@@ -4081,6 +4093,7 @@ extern "C" {
40814093 spbufp : * mut * mut spwd ,
40824094 ) -> :: c_int ;
40834095
4096+ #[ cfg( not( target_env = "ohos" ) ) ]
40844097 pub fn shm_open ( name : * const c_char , oflag : :: c_int , mode : mode_t ) -> :: c_int ;
40854098
40864099 // System V IPC
@@ -4187,36 +4200,45 @@ extern "C" {
41874200 id : :: c_int ,
41884201 data : * mut :: c_char ,
41894202 ) -> :: c_int ;
4203+ #[ cfg( not( target_env = "ohos" ) ) ]
41904204 pub fn mq_open ( name : * const :: c_char , oflag : :: c_int , ...) -> :: mqd_t ;
4205+ #[ cfg( not( target_env = "ohos" ) ) ]
41914206 pub fn mq_close ( mqd : :: mqd_t ) -> :: c_int ;
4207+ #[ cfg( not( target_env = "ohos" ) ) ]
41924208 pub fn mq_unlink ( name : * const :: c_char ) -> :: c_int ;
4209+ #[ cfg( not( target_env = "ohos" ) ) ]
41934210 pub fn mq_receive (
41944211 mqd : :: mqd_t ,
41954212 msg_ptr : * mut :: c_char ,
41964213 msg_len : :: size_t ,
41974214 msg_prio : * mut :: c_uint ,
41984215 ) -> :: ssize_t ;
4216+ #[ cfg( not( target_env = "ohos" ) ) ]
41994217 pub fn mq_timedreceive (
42004218 mqd : :: mqd_t ,
42014219 msg_ptr : * mut :: c_char ,
42024220 msg_len : :: size_t ,
42034221 msg_prio : * mut :: c_uint ,
42044222 abs_timeout : * const :: timespec ,
42054223 ) -> :: ssize_t ;
4224+ #[ cfg( not( target_env = "ohos" ) ) ]
42064225 pub fn mq_send (
42074226 mqd : :: mqd_t ,
42084227 msg_ptr : * const :: c_char ,
42094228 msg_len : :: size_t ,
42104229 msg_prio : :: c_uint ,
42114230 ) -> :: c_int ;
4231+ #[ cfg( not( target_env = "ohos" ) ) ]
42124232 pub fn mq_timedsend (
42134233 mqd : :: mqd_t ,
42144234 msg_ptr : * const :: c_char ,
42154235 msg_len : :: size_t ,
42164236 msg_prio : :: c_uint ,
42174237 abs_timeout : * const :: timespec ,
42184238 ) -> :: c_int ;
4239+ #[ cfg( not( target_env = "ohos" ) ) ]
42194240 pub fn mq_getattr ( mqd : :: mqd_t , attr : * mut :: mq_attr ) -> :: c_int ;
4241+ #[ cfg( not( target_env = "ohos" ) ) ]
42204242 pub fn mq_setattr ( mqd : :: mqd_t , newattr : * const :: mq_attr , oldattr : * mut :: mq_attr ) -> :: c_int ;
42214243 pub fn epoll_pwait (
42224244 epfd : :: c_int ,
@@ -4284,6 +4306,7 @@ extern "C" {
42844306
42854307 pub fn posix_madvise ( addr : * mut :: c_void , len : :: size_t , advice : :: c_int ) -> :: c_int ;
42864308
4309+ #[ cfg( not( target_env = "ohos" ) ) ]
42874310 pub fn shm_unlink ( name : * const :: c_char ) -> :: c_int ;
42884311
42894312 pub fn seekdir ( dirp : * mut :: DIR , loc : :: c_long ) ;
@@ -4389,6 +4412,7 @@ extern "C" {
43894412 attr : * mut pthread_mutexattr_t ,
43904413 protocol : :: c_int ,
43914414 ) -> :: c_int ;
4415+ #[ cfg( not( target_env = "ohos" ) ) ]
43924416 pub fn pthread_mutex_consistent ( mutex : * mut pthread_mutex_t ) -> :: c_int ;
43934417 pub fn pthread_mutex_timedlock (
43944418 lock : * mut pthread_mutex_t ,
@@ -4487,6 +4511,7 @@ extern "C" {
44874511 pub fn pthread_sigmask ( how : :: c_int , set : * const sigset_t , oldset : * mut sigset_t ) -> :: c_int ;
44884512 pub fn sem_open ( name : * const :: c_char , oflag : :: c_int , ...) -> * mut sem_t ;
44894513 pub fn getgrnam ( name : * const :: c_char ) -> * mut :: group ;
4514+ #[ cfg( not( target_env = "ohos" ) ) ]
44904515 pub fn pthread_cancel ( thread : :: pthread_t ) -> :: c_int ;
44914516 pub fn pthread_kill ( thread : :: pthread_t , sig : :: c_int ) -> :: c_int ;
44924517 pub fn sem_unlink ( name : * const :: c_char ) -> :: c_int ;
@@ -4522,10 +4547,12 @@ extern "C" {
45224547 attr : * const pthread_mutexattr_t ,
45234548 pshared : * mut :: c_int ,
45244549 ) -> :: c_int ;
4550+ #[ cfg( not( target_env = "ohos" ) ) ]
45254551 pub fn pthread_mutexattr_getrobust (
45264552 attr : * const pthread_mutexattr_t ,
45274553 robustness : * mut :: c_int ,
45284554 ) -> :: c_int ;
4555+ #[ cfg( not( target_env = "ohos" ) ) ]
45294556 pub fn pthread_mutexattr_setrobust (
45304557 attr : * mut pthread_mutexattr_t ,
45314558 robustness : :: c_int ,
@@ -4729,7 +4756,7 @@ cfg_if! {
47294756 if #[ cfg( target_env = "uclibc" ) ] {
47304757 mod uclibc;
47314758 pub use self :: uclibc:: * ;
4732- } else if #[ cfg( target_env = "musl" ) ] {
4759+ } else if #[ cfg( any ( target_env = "musl" , target_env = "ohos" ) ) ] {
47334760 mod musl;
47344761 pub use self :: musl:: * ;
47354762 } else if #[ cfg( target_env = "gnu" ) ] {
0 commit comments