Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
00eb0886
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
1 年多 前同步成功
通知
37
Star
125
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Musl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
00eb0886
编写于
8月 15, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 15, 2022
浏览文件
操作
浏览文件
下载
差异文件
!465 增加NDK符号
Merge pull request !465 from maweiye/ndksymbols
上级
62f1bb8e
11cc6ed2
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
237 addition
and
3 deletion
+237
-3
ndk_musl_include/info/application_target_sdk_version.h
ndk_musl_include/info/application_target_sdk_version.h
+12
-0
ndk_musl_include/info/device_api_version.h
ndk_musl_include/info/device_api_version.h
+6
-0
ndk_musl_include/info/fatal_message.h
ndk_musl_include/info/fatal_message.h
+12
-0
ndk_musl_include/pthread.h
ndk_musl_include/pthread.h
+151
-2
ndk_musl_include/sched.h
ndk_musl_include/sched.h
+1
-0
ndk_musl_include/sys/tgkill.h
ndk_musl_include/sys/tgkill.h
+36
-0
ndk_script/adapter/libc.ndk.json
ndk_script/adapter/libc.ndk.json
+19
-1
未找到文件。
ndk_musl_include/info/application_target_sdk_version.h
浏览文件 @
00eb0886
...
...
@@ -25,6 +25,18 @@ extern "C" {
#define SDK_VERSION_8 8
#define SDK_VERSION_9 9
/**
* @brief Get the target sdk version number of the application.
* @return The target sdk version number.
*/
int
get_application_target_sdk_version
(
void
);
/**
* @brief Set the target sdk version number of the application.
* @param target The target sdk version number.
*/
void
set_application_target_sdk_version
(
int
target
);
#ifdef __cplusplus
}
#endif
...
...
ndk_musl_include/info/device_api_version.h
浏览文件 @
00eb0886
...
...
@@ -20,6 +20,12 @@
extern
"C"
{
#endif
/**
* @brief Get the api version number of the device.
* @return The api version number of the device.
*/
int
get_device_api_version
(
void
);
#ifdef __cplusplus
}
#endif
...
...
ndk_musl_include/info/fatal_message.h
浏览文件 @
00eb0886
...
...
@@ -28,6 +28,18 @@ typedef struct fatal_msg {
char
msg
[
0
];
}
fatal_msg_t
;
/**
* @brief Set up fatal message
* @param msg The fatal message
*/
void
set_fatal_message
(
const
char
*
msg
);
/**
* @brief Get the set fatal message
* @return Address of fatal message
*/
fatal_msg_t
*
get_fatal_message
(
void
);
#ifdef __cplusplus
}
#endif
...
...
ndk_musl_include/pthread.h
浏览文件 @
00eb0886
...
...
@@ -128,12 +128,97 @@ int pthread_mutex_unlock(pthread_mutex_t *);
int
pthread_mutex_trylock
(
pthread_mutex_t
*
);
int
pthread_mutex_timedlock
(
pthread_mutex_t
*
__restrict
,
const
struct
timespec
*
__restrict
);
int
pthread_mutex_destroy
(
pthread_mutex_t
*
);
/**
* @brief lock the mutex object referenced by mutex. If the mutex is already locked,
* the calling thread shall block until the mutex becomes available as in the
* pthread_mutex_lock() function. If the mutex cannot be locked without waiting for
* another thread to unlock the mutex, this wait shall be terminated when the specified
* timeout expires. The timeout shall be based on the CLOCK_REALTIME or CLOCK_MONOTONIC clock.
* The resolution of the timeout shall be the resolution of the clock on which it is based.
* @param mutex a robust mutex and the process containing the owning thread terminated while holding the mutex lock.
* @param clock_id specified CLOCK_REALTIME or CLOCK_MONOTONIC clock.
* @param timespec the timeout shall expire specified by abstime passes.
* @return clocklock result.
* @retval 0 is returned on success.
* @retval -1 is returned on failure, and errno is set to indicate the error.
*/
int
pthread_mutex_clocklock
(
pthread_mutex_t
*
__restrict
,
clockid_t
,
const
struct
timespec
*
__restrict
);
/**
* @brief lock the mutex object referenced by mutex. If the mutex is already locked,
* the calling thread shall block until the mutex becomes available as in the
* pthread_mutex_lock() function. If the mutex cannot be locked without waiting for
* another thread to unlock the mutex, this wait shall be terminated when the specified
* timeout expires. The timeout shall be based on the CLOCK_MONOTONIC clock.
* The resolution of the timeout shall be the resolution of the clock on which it is based.
* @param mutex a robust mutex and the process containing the owning thread terminated while holding the mutex lock.
* @param timespec the timeout shall expire specified by abstime passes.
* @return clocklock result.
* @retval 0 is returned on success.
* @retval -1 is returned on failure, and errno is set to indicate the error.
*/
int
pthread_mutex_timedlock_monotonic_np
(
pthread_mutex_t
*
__restrict
,
const
struct
timespec
*
__restrict
);
/**
* @brief lock the mutex object referenced by mutex. If the mutex is already locked,
* the calling thread shall block until the mutex becomes available as in the
* pthread_mutex_lock() function. If the mutex cannot be locked without waiting for
* another thread to unlock the mutex, this wait shall be terminated when the specified
* timeout expires. The timeout shall be based on the CLOCK_MONOTONIC clock.
* The resolution of the timeout shall be the resolution of the clock on which it is based.
* @param mutex a robust mutex and the process containing the owning thread terminated while holding the mutex lock.
* @param ms the timeout shall expire specified by relative time(ms) passes.
* @return clocklock result.
* @retval 0 is returned on success.
* @retval -1 is returned on failure, and errno is set to indicate the error.
*/
int
pthread_mutex_lock_timeout_np
(
pthread_mutex_t
*
__restrict
,
unsigned
int
);
int
pthread_cond_init
(
pthread_cond_t
*
__restrict
,
const
pthread_condattr_t
*
__restrict
);
int
pthread_cond_destroy
(
pthread_cond_t
*
);
int
pthread_cond_wait
(
pthread_cond_t
*
__restrict
,
pthread_mutex_t
*
__restrict
);
int
pthread_cond_timedwait
(
pthread_cond_t
*
__restrict
,
pthread_mutex_t
*
__restrict
,
const
struct
timespec
*
__restrict
);
/**
* @brief The thread waits for a signal to trigger, and if timeout or signal is triggered,
* the thread wakes up.
* @param pthread_cond_t Condition variables for multithreading.
* @param pthread_mutex_t Thread mutex variable.
* @param clockid_t Clock ID used in clock and timer functions.
* @param timespec The timeout shall expire specified by abstime passes.
* @return pthread_cond_clockwait result.
* @retval 0 pthread_cond_clockwait successful.
* @retval ETIMEDOUT pthread_cond_clockwait Connection timed out.
* @retval EINVAL pthread_cond_clockwait error.
*/
int
pthread_cond_clockwait
(
pthread_cond_t
*
__restrict
,
pthread_mutex_t
*
__restrict
,
clockid_t
,
const
struct
timespec
*
__restrict
);
/**
* @brief Condition variables have an initialization option to use CLOCK_MONOTONIC.
* The thread waits for a signal to trigger, and if timeout or signal is triggered,
* the thread wakes up.
* @param pthread_cond_t Condition variables for multithreading.
* @param pthread_mutex_t Thread mutex variable.
* @param timespec The timeout shall expire specified by abstime passes.
* @return pthread_cond_timedwait_monotonic_np result.
* @retval 0 pthread_cond_timedwait_monotonic_np successful.
* @retval ETIMEDOUT pthread_cond_timedwait_monotonic_np Connection timed out.
* @retval EINVAL pthread_cond_timedwait_monotonic_np error.
*/
int
pthread_cond_timedwait_monotonic_np
(
pthread_cond_t
*
__restrict
,
pthread_mutex_t
*
__restrict
,
const
struct
timespec
*
__restrict
);
/**
* @brief Condition variables have an initialization option to use CLOCK_MONOTONIC and The time
* parameter is in milliseconds. The thread waits for a signal to trigger, and if timeout or
* signal is triggered, the thread wakes up.
* @param pthread_cond_t Condition variables for multithreading.
* @param pthread_mutex_t Thread mutex variable.
* @param unsigned Timeout, in milliseconds.
* @return pthread_cond_timeout_np result.
* @retval 0 pthread_cond_timeout_np successful.
* @retval ETIMEDOUT pthread_cond_timeout_np Connection timed out.
* @retval EINVAL pthread_cond_timeout_np error.
*/
int
pthread_cond_timeout_np
(
pthread_cond_t
*
__restrict
,
pthread_mutex_t
*
__restrict
,
unsigned
int
);
int
pthread_cond_broadcast
(
pthread_cond_t
*
);
int
pthread_cond_signal
(
pthread_cond_t
*
);
...
...
@@ -142,11 +227,74 @@ int pthread_rwlock_destroy(pthread_rwlock_t *);
int
pthread_rwlock_rdlock
(
pthread_rwlock_t
*
);
int
pthread_rwlock_tryrdlock
(
pthread_rwlock_t
*
);
int
pthread_rwlock_timedrdlock
(
pthread_rwlock_t
*
__restrict
,
const
struct
timespec
*
__restrict
);
/**
* @brief Apply a read lock to the read-write lock referenced by rwlock as in the
* pthread_rwlock_rdlock() function. However, if the lock cannot be acquired without
* waiting for other threads to unlock the lock, this wait shall be terminated when
* the specified timeout expires. The timeout shall expire when the absolute time specified by
* abstime passes, as measured by the clock on which timeouts are based, or if the absolute time
* specified by abstime has already been passed at the time of the call.
* The timeout shall be based on the CLOCK_REALTIME or CLOCK_MONOTONIC clock.
* @param rw a read lock to the read-write lock referenced.
* @param clock_id specified CLOCK_REALTIME or CLOCK_MONOTONIC clock.
* @param timespec the timeout shall expire specified by abstime passes.
* @return clockrdlock result.
* @retval 0 is returned on success.
* @retval -1 is returned on failure, and errno is set to indicate the error.
*/
int
pthread_rwlock_clockrdlock
(
pthread_rwlock_t
*
__restrict
,
clockid_t
,
const
struct
timespec
*
__restrict
);
/**
* @brief Apply a read lock to the read-write lock referenced by rwlock as in the
* pthread_rwlock_rdlock() function. However, if the lock cannot be acquired without
* waiting for other threads to unlock the lock, this wait shall be terminated when
* the specified timeout expires. The timeout shall expire when the absolute time specified by
* abstime passes, as measured by the clock on which timeouts are based, or if the absolute time
* specified by abstime has already been passed at the time of the call.
* The timeout shall be based on the CLOCK_MONOTONIC clock.
* @param rw a read lock to the read-write lock referenced.
* @param timespec the timeout shall expire specified by abstime passes.
* @return clockrdlock result.
* @retval 0 is returned on success.
* @retval -1 is returned on failure, and errno is set to indicate the error.
*/
int
pthread_rwlock_timedrdlock_monotonic_np
(
pthread_rwlock_t
*
__restrict
,
const
struct
timespec
*
__restrict
);
int
pthread_rwlock_wrlock
(
pthread_rwlock_t
*
);
int
pthread_rwlock_trywrlock
(
pthread_rwlock_t
*
);
int
pthread_rwlock_timedwrlock
(
pthread_rwlock_t
*
__restrict
,
const
struct
timespec
*
__restrict
);
int
pthread_rwlock_unlock
(
pthread_rwlock_t
*
);
/**
* @brief Read-write lock variables have an initialization option to use CLOCK_MONOTONIC.
* apply a read lock to the read-write lock referenced by rwlock as in the
* pthread_rwlock_wrlock() function. However, if the lock cannot be acquired without
* waiting for other threads to unlock the lock, this wait shall be terminated when
* the specified timeout expires. The timeout shall expire when the absolute time specified by
* abstime passes, as measured by the clock on which timeouts are based, or if the absolute time
* specified by abstime has already been passed at the time of the call.
* The timeout shall be based on the CLOCK_MONOTONIC clock.
* @param rw a read lock to the read-write lock referenced.
* @param timespec the timeout shall expire specified by abstime passes.
* @return clockrdlock result.
* @retval 0 is returned on success.
* @retval -1 is returned on failure, and errno is set to indicate the error.
*/
int
pthread_rwlock_timedwrlock_monotonic_np
(
pthread_rwlock_t
*
__restrict
,
const
struct
timespec
*
__restrict
);
/**
* @brief Apply a read lock to the read-write lock referenced by rwlock as in the
* pthread_rwlock_wrlock() function. However, if the lock cannot be acquired without
* waiting for other threads to unlock the lock, this wait shall be terminated when
* the specified timeout expires. The timeout shall expire when the absolute time specified by
* abstime passes, as measured by the clock on which timeouts are based, or if the absolute time
* specified by abstime has already been passed at the time of the call.
* The timeout shall be based on the CLOCK_REALTIME or CLOCK_MONOTONIC clock.
* @param rw a read lock to the read-write lock referenced.
* @param clock_id specified CLOCK_REALTIME or CLOCK_MONOTONIC clock.
* @param timespec the timeout shall expire specified by abstime passes.
* @return clockrdlock result.
* @retval 0 is returned on success.
* @retval -1 is returned on failure, and errno is set to indicate the error.
*/
int
pthread_rwlock_clockwrlock
(
pthread_rwlock_t
*
__restrict
,
clockid_t
,
const
struct
timespec
*
__restrict
);
int
pthread_spin_init
(
pthread_spinlock_t
*
,
int
);
int
pthread_spin_destroy
(
pthread_spinlock_t
*
);
...
...
@@ -229,6 +377,7 @@ void _pthread_cleanup_pop(struct __ptcb *, int);
struct
cpu_set_t
;
int
pthread_getattr_np
(
pthread_t
,
pthread_attr_t
*
);
int
pthread_setname_np
(
pthread_t
,
const
char
*
);
int
pthread_getname_np
(
pthread_t
,
char
*
,
size_t
);
#endif
#if _REDIR_TIME64
...
...
ndk_musl_include/sched.h
浏览文件 @
00eb0886
...
...
@@ -85,6 +85,7 @@ void *calloc(size_t, size_t);
void
free
(
void
*
);
typedef
struct
cpu_set_t
{
unsigned
long
__bits
[
128
/
sizeof
(
long
)];
}
cpu_set_t
;
cpu_set_t
*
__sched_cpualloc
(
size_t
__count
);
int
__sched_cpucount
(
size_t
,
const
cpu_set_t
*
);
int
sched_getcpu
(
void
);
int
sched_getaffinity
(
pid_t
,
size_t
,
cpu_set_t
*
);
...
...
ndk_musl_include/sys/tgkill.h
0 → 100644
浏览文件 @
00eb0886
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _SYS_TGKILL_H
#define _SYS_TGKILL_H
#ifdef __cplusplus
extern
"C"
{
#endif
/**
* @brief send any signal to any process group or process.
* @param tgid the group ID of the calling process.
* @param tid the thread ID of the calling process.
* @param sig the actual signal.
* @return tgkill result.
* @retval 0 is returned on success.
* @retval -1 is returned on failure, and errno is set to indicate the error.
*/
int
tgkill
(
int
tgid
,
int
tid
,
int
sig
);
#ifdef __cplusplus
}
#endif
#endif
\ No newline at end of file
ndk_script/adapter/libc.ndk.json
浏览文件 @
00eb0886
...
...
@@ -1498,5 +1498,23 @@
{
"name"
:
"stdin"
,
"type"
:
"variable"
},
{
"name"
:
"stdout"
,
"type"
:
"variable"
},
{
"name"
:
"timezone"
,
"type"
:
"variable"
},
{
"name"
:
"tzname"
,
"type"
:
"variable"
}
{
"name"
:
"tzname"
,
"type"
:
"variable"
},
{
"name"
:
"__sched_cpualloc"
},
{
"name"
:
"get_application_target_sdk_version"
},
{
"name"
:
"get_device_api_version"
},
{
"name"
:
"get_fatal_message"
},
{
"name"
:
"pthread_cond_clockwait"
},
{
"name"
:
"pthread_cond_timedwait_monotonic_np"
},
{
"name"
:
"pthread_cond_timeout_np"
},
{
"name"
:
"pthread_getname_np"
},
{
"name"
:
"pthread_mutex_lock_timeout_np"
},
{
"name"
:
"pthread_mutex_timedlock_monotonic_np"
},
{
"name"
:
"pthread_mutex_clocklock"
},
{
"name"
:
"pthread_rwlock_clockrdlock"
},
{
"name"
:
"pthread_rwlock_clockwrlock"
},
{
"name"
:
"pthread_rwlock_timedrdlock_monotonic_np"
},
{
"name"
:
"pthread_rwlock_timedwrlock_monotonic_np"
},
{
"name"
:
"set_application_target_sdk_version"
},
{
"name"
:
"set_fatal_message"
},
{
"name"
:
"tgkill"
}
]
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录