471
471
__pgrp: :: pid_t,
472
472
__sd: :: sigset_t,
473
473
__ss: :: sigset_t,
474
- #[ cfg( target_env = "musl" ) ]
474
+ #[ cfg( any ( target_env = "musl" , target_env = "ohos" ) ) ]
475
475
__prio: :: c_int,
476
- #[ cfg( not( target_env = "musl" ) ) ]
476
+ #[ cfg( not( any ( target_env = "musl" , target_env = "ohos" ) ) ) ]
477
477
__sp: :: sched_param,
478
478
__policy: :: c_int,
479
479
__pad: [ :: c_int; 16 ] ,
@@ -1225,7 +1225,7 @@ cfg_if! {
1225
1225
}
1226
1226
1227
1227
cfg_if ! {
1228
- if #[ cfg( any( target_env = "gnu" , target_env = "musl" ) ) ] {
1228
+ if #[ cfg( any( target_env = "gnu" , target_env = "musl" , target_env = "ohos" ) ) ] {
1229
1229
pub const ABDAY_1 : :: nl_item = 0x20000 ;
1230
1230
pub const ABDAY_2 : :: nl_item = 0x20001 ;
1231
1231
pub const ABDAY_3 : :: nl_item = 0x20002 ;
@@ -3972,17 +3972,25 @@ safe_f! {
3972
3972
cfg_if ! {
3973
3973
if #[ cfg( not( target_env = "uclibc" ) ) ] {
3974
3974
extern "C" {
3975
+ #[ cfg( not( target_env = "ohos" ) ) ]
3975
3976
pub fn aio_read( aiocbp: * mut aiocb) -> :: c_int;
3977
+ #[ cfg( not( target_env = "ohos" ) ) ]
3976
3978
pub fn aio_write( aiocbp: * mut aiocb) -> :: c_int;
3979
+ #[ cfg( not( target_env = "ohos" ) ) ]
3977
3980
pub fn aio_fsync( op: :: c_int, aiocbp: * mut aiocb) -> :: c_int;
3981
+ #[ cfg( not( target_env = "ohos" ) ) ]
3978
3982
pub fn aio_error( aiocbp: * const aiocb) -> :: c_int;
3983
+ #[ cfg( not( target_env = "ohos" ) ) ]
3979
3984
pub fn aio_return( aiocbp: * mut aiocb) -> :: ssize_t;
3985
+ #[ cfg( not( target_env = "ohos" ) ) ]
3980
3986
pub fn aio_suspend(
3981
3987
aiocb_list: * const * const aiocb,
3982
3988
nitems: :: c_int,
3983
3989
timeout: * const :: timespec,
3984
3990
) -> :: c_int;
3991
+ #[ cfg( not( target_env = "ohos" ) ) ]
3985
3992
pub fn aio_cancel( fd: :: c_int, aiocbp: * mut aiocb) -> :: c_int;
3993
+ #[ cfg( not( target_env = "ohos" ) ) ]
3986
3994
pub fn lio_listio(
3987
3995
mode: :: c_int,
3988
3996
aiocb_list: * const * mut aiocb,
@@ -4039,7 +4047,10 @@ cfg_if! {
4039
4047
}
4040
4048
4041
4049
extern "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
+ ) ]
4043
4054
pub fn strerror_r ( errnum : :: c_int , buf : * mut c_char , buflen : :: size_t ) -> :: c_int ;
4044
4055
4045
4056
pub fn abs ( i : :: c_int ) -> :: c_int ;
@@ -4073,6 +4084,7 @@ extern "C" {
4073
4084
// Only `getspnam_r` is implemented for musl, out of all of the reenterant
4074
4085
// functions from `shadow.h`.
4075
4086
// https://git.musl-libc.org/cgit/musl/tree/include/shadow.h
4087
+ #[ cfg( not( target_env = "ohos" ) ) ]
4076
4088
pub fn getspnam_r (
4077
4089
name : * const :: c_char ,
4078
4090
spbuf : * mut spwd ,
@@ -4081,6 +4093,7 @@ extern "C" {
4081
4093
spbufp : * mut * mut spwd ,
4082
4094
) -> :: c_int ;
4083
4095
4096
+ #[ cfg( not( target_env = "ohos" ) ) ]
4084
4097
pub fn shm_open ( name : * const c_char , oflag : :: c_int , mode : mode_t ) -> :: c_int ;
4085
4098
4086
4099
// System V IPC
@@ -4187,36 +4200,45 @@ extern "C" {
4187
4200
id : :: c_int ,
4188
4201
data : * mut :: c_char ,
4189
4202
) -> :: c_int ;
4203
+ #[ cfg( not( target_env = "ohos" ) ) ]
4190
4204
pub fn mq_open ( name : * const :: c_char , oflag : :: c_int , ...) -> :: mqd_t ;
4205
+ #[ cfg( not( target_env = "ohos" ) ) ]
4191
4206
pub fn mq_close ( mqd : :: mqd_t ) -> :: c_int ;
4207
+ #[ cfg( not( target_env = "ohos" ) ) ]
4192
4208
pub fn mq_unlink ( name : * const :: c_char ) -> :: c_int ;
4209
+ #[ cfg( not( target_env = "ohos" ) ) ]
4193
4210
pub fn mq_receive (
4194
4211
mqd : :: mqd_t ,
4195
4212
msg_ptr : * mut :: c_char ,
4196
4213
msg_len : :: size_t ,
4197
4214
msg_prio : * mut :: c_uint ,
4198
4215
) -> :: ssize_t ;
4216
+ #[ cfg( not( target_env = "ohos" ) ) ]
4199
4217
pub fn mq_timedreceive (
4200
4218
mqd : :: mqd_t ,
4201
4219
msg_ptr : * mut :: c_char ,
4202
4220
msg_len : :: size_t ,
4203
4221
msg_prio : * mut :: c_uint ,
4204
4222
abs_timeout : * const :: timespec ,
4205
4223
) -> :: ssize_t ;
4224
+ #[ cfg( not( target_env = "ohos" ) ) ]
4206
4225
pub fn mq_send (
4207
4226
mqd : :: mqd_t ,
4208
4227
msg_ptr : * const :: c_char ,
4209
4228
msg_len : :: size_t ,
4210
4229
msg_prio : :: c_uint ,
4211
4230
) -> :: c_int ;
4231
+ #[ cfg( not( target_env = "ohos" ) ) ]
4212
4232
pub fn mq_timedsend (
4213
4233
mqd : :: mqd_t ,
4214
4234
msg_ptr : * const :: c_char ,
4215
4235
msg_len : :: size_t ,
4216
4236
msg_prio : :: c_uint ,
4217
4237
abs_timeout : * const :: timespec ,
4218
4238
) -> :: c_int ;
4239
+ #[ cfg( not( target_env = "ohos" ) ) ]
4219
4240
pub fn mq_getattr ( mqd : :: mqd_t , attr : * mut :: mq_attr ) -> :: c_int ;
4241
+ #[ cfg( not( target_env = "ohos" ) ) ]
4220
4242
pub fn mq_setattr ( mqd : :: mqd_t , newattr : * const :: mq_attr , oldattr : * mut :: mq_attr ) -> :: c_int ;
4221
4243
pub fn epoll_pwait (
4222
4244
epfd : :: c_int ,
@@ -4284,6 +4306,7 @@ extern "C" {
4284
4306
4285
4307
pub fn posix_madvise ( addr : * mut :: c_void , len : :: size_t , advice : :: c_int ) -> :: c_int ;
4286
4308
4309
+ #[ cfg( not( target_env = "ohos" ) ) ]
4287
4310
pub fn shm_unlink ( name : * const :: c_char ) -> :: c_int ;
4288
4311
4289
4312
pub fn seekdir ( dirp : * mut :: DIR , loc : :: c_long ) ;
@@ -4389,6 +4412,7 @@ extern "C" {
4389
4412
attr : * mut pthread_mutexattr_t ,
4390
4413
protocol : :: c_int ,
4391
4414
) -> :: c_int ;
4415
+ #[ cfg( not( target_env = "ohos" ) ) ]
4392
4416
pub fn pthread_mutex_consistent ( mutex : * mut pthread_mutex_t ) -> :: c_int ;
4393
4417
pub fn pthread_mutex_timedlock (
4394
4418
lock : * mut pthread_mutex_t ,
@@ -4487,6 +4511,7 @@ extern "C" {
4487
4511
pub fn pthread_sigmask ( how : :: c_int , set : * const sigset_t , oldset : * mut sigset_t ) -> :: c_int ;
4488
4512
pub fn sem_open ( name : * const :: c_char , oflag : :: c_int , ...) -> * mut sem_t ;
4489
4513
pub fn getgrnam ( name : * const :: c_char ) -> * mut :: group ;
4514
+ #[ cfg( not( target_env = "ohos" ) ) ]
4490
4515
pub fn pthread_cancel ( thread : :: pthread_t ) -> :: c_int ;
4491
4516
pub fn pthread_kill ( thread : :: pthread_t , sig : :: c_int ) -> :: c_int ;
4492
4517
pub fn sem_unlink ( name : * const :: c_char ) -> :: c_int ;
@@ -4522,10 +4547,12 @@ extern "C" {
4522
4547
attr : * const pthread_mutexattr_t ,
4523
4548
pshared : * mut :: c_int ,
4524
4549
) -> :: c_int ;
4550
+ #[ cfg( not( target_env = "ohos" ) ) ]
4525
4551
pub fn pthread_mutexattr_getrobust (
4526
4552
attr : * const pthread_mutexattr_t ,
4527
4553
robustness : * mut :: c_int ,
4528
4554
) -> :: c_int ;
4555
+ #[ cfg( not( target_env = "ohos" ) ) ]
4529
4556
pub fn pthread_mutexattr_setrobust (
4530
4557
attr : * mut pthread_mutexattr_t ,
4531
4558
robustness : :: c_int ,
@@ -4729,7 +4756,7 @@ cfg_if! {
4729
4756
if #[ cfg( target_env = "uclibc" ) ] {
4730
4757
mod uclibc;
4731
4758
pub use self :: uclibc:: * ;
4732
- } else if #[ cfg( target_env = "musl" ) ] {
4759
+ } else if #[ cfg( any ( target_env = "musl" , target_env = "ohos" ) ) ] {
4733
4760
mod musl;
4734
4761
pub use self :: musl:: * ;
4735
4762
} else if #[ cfg( target_env = "gnu" ) ] {
0 commit comments