Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
嗨,你的益达!
rt-thread
提交
c33a2150
R
rt-thread
项目概览
嗨,你的益达!
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
c33a2150
编写于
6月 10, 2023
作者:
H
Huang Xilong
提交者:
GitHub
6月 10, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[comment][libc] add some comments for functions in posix_signal (#7647)
上级
0f998f6b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
43 addition
and
6 deletion
+43
-6
components/libc/posix/signal/posix_signal.c
components/libc/posix/signal/posix_signal.c
+43
-6
未找到文件。
components/libc/posix/signal/posix_signal.c
浏览文件 @
c33a2150
...
@@ -44,7 +44,6 @@ void (*signal(int sig, void (*func)(int))) (int)
...
@@ -44,7 +44,6 @@ void (*signal(int sig, void (*func)(int))) (int)
*
*
* @return Returns 0 on success.
* @return Returns 0 on success.
*/
*/
int
sigprocmask
(
int
how
,
const
sigset_t
*
set
,
sigset_t
*
oset
)
int
sigprocmask
(
int
how
,
const
sigset_t
*
set
,
sigset_t
*
oset
)
{
{
rt_base_t
level
;
rt_base_t
level
;
...
@@ -90,7 +89,16 @@ int sigpending (sigset_t *set)
...
@@ -90,7 +89,16 @@ int sigpending (sigset_t *set)
sigprocmask
(
SIG_SETMASK
,
RT_NULL
,
set
);
sigprocmask
(
SIG_SETMASK
,
RT_NULL
,
set
);
return
0
;
return
0
;
}
}
/**
* @brief This function will temporarily replace the signal mask of the calling thread
* with the mask given and then suspends the thread until delivery of an expected signal
* or a signal whose action is to terminate a process.
*
* @param set is a pointer of a sigset_t object that is used to replace the original mask of the calling thread.
*
* @return Returns 0 on success.
* If the return value is any other values, it means that the signal wait failed.
*/
int
sigsuspend
(
const
sigset_t
*
set
)
int
sigsuspend
(
const
sigset_t
*
set
)
{
{
int
ret
=
0
;
int
ret
=
0
;
...
@@ -125,7 +133,6 @@ int sigsuspend (const sigset_t *set)
...
@@ -125,7 +133,6 @@ int sigsuspend (const sigset_t *set)
*
*
* @return Returns 0 on success or -1 on failure.
* @return Returns 0 on success or -1 on failure.
*/
*/
int
sigaction
(
int
signum
,
const
struct
sigaction
*
act
,
struct
sigaction
*
oldact
)
int
sigaction
(
int
signum
,
const
struct
sigaction
*
act
,
struct
sigaction
*
oldact
)
{
{
rt_sighandler_t
old
=
RT_NULL
;
rt_sighandler_t
old
=
RT_NULL
;
...
@@ -145,7 +152,19 @@ int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact)
...
@@ -145,7 +152,19 @@ int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact)
return
0
;
return
0
;
}
}
/**
* @brief This function will suspends execution of the calling thread until one of
* the signals in the given set is pending. If none of the signals specified
* are pending, it will wait for the specified time interval.
*
* @param set is the set of signal values to be waited for.
*
* @param info is a pointer to the received signal info.
*
* @param timeout is a pointer to a timespec structure that specifys the waiting time.
*
* @return Return 0 on success. Otherwise, return -1 and set errno to indicate the error.
*/
int
sigtimedwait
(
const
sigset_t
*
set
,
siginfo_t
*
info
,
const
struct
timespec
*
timeout
)
int
sigtimedwait
(
const
sigset_t
*
set
,
siginfo_t
*
info
,
const
struct
timespec
*
timeout
)
{
{
int
ret
=
0
;
int
ret
=
0
;
...
@@ -162,7 +181,16 @@ int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *ti
...
@@ -162,7 +181,16 @@ int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *ti
errno
=
ret
;
errno
=
ret
;
return
-
1
;
return
-
1
;
}
}
/**
* @brief This function will suspend execution of the calling thread until one of
* the specified signal becomes pending and return the signal number.
*
* @param set is the set of signal values to be waited for.
*
* @param sig is a pointer to the received signal number.
*
* @return Return 0 on success or -1 on failure.
*/
int
sigwait
(
const
sigset_t
*
set
,
int
*
sig
)
int
sigwait
(
const
sigset_t
*
set
,
int
*
sig
)
{
{
siginfo_t
si
;
siginfo_t
si
;
...
@@ -172,7 +200,16 @@ int sigwait(const sigset_t *set, int *sig)
...
@@ -172,7 +200,16 @@ int sigwait(const sigset_t *set, int *sig)
*
sig
=
si
.
si_signo
;
*
sig
=
si
.
si_signo
;
return
0
;
return
0
;
}
}
/**
* @brief This function will suspend execution of the calling thread until one of
* the specified signal is pending.
*
* @param set is the set of signal values to be waited for.
*
* @param info is a pointer to the received signal info.
*
* @return Return 0 on success or -1 on failure.
*/
int
sigwaitinfo
(
const
sigset_t
*
set
,
siginfo_t
*
info
)
int
sigwaitinfo
(
const
sigset_t
*
set
,
siginfo_t
*
info
)
{
{
return
sigtimedwait
(
set
,
info
,
NULL
);
return
sigtimedwait
(
set
,
info
,
NULL
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录