Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
83f800ab
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看板
提交
83f800ab
编写于
2月 18, 2023
作者:
D
dhy308
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix review issues.
Issue: I6AEEI Test: Build & Boot Devices Signed-off-by:
N
dhy308
<
tony.gan@huawei.com
>
上级
50a6e9ab
变更
41
隐藏空白更改
内联
并排
Showing
41 changed file
with
534 addition
and
159 deletion
+534
-159
libc-test/src/functionalext/common/sigchain_util.h
libc-test/src/functionalext/common/sigchain_util.h
+5
-1
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_a.c
...c/functionalext/sigchain/sigchain_add_special_handler_a.c
+8
-3
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_b.c
...c/functionalext/sigchain/sigchain_add_special_handler_b.c
+11
-4
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_c.c
...c/functionalext/sigchain/sigchain_add_special_handler_c.c
+9
-3
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_d.c
...c/functionalext/sigchain/sigchain_add_special_handler_d.c
+9
-4
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_e.c
...c/functionalext/sigchain/sigchain_add_special_handler_e.c
+12
-6
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_f.c
...c/functionalext/sigchain/sigchain_add_special_handler_f.c
+10
-4
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_g.c
...c/functionalext/sigchain/sigchain_add_special_handler_g.c
+10
-3
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_h.c
...c/functionalext/sigchain/sigchain_add_special_handler_h.c
+18
-4
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_i.c
...c/functionalext/sigchain/sigchain_add_special_handler_i.c
+16
-3
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_j.c
...c/functionalext/sigchain/sigchain_add_special_handler_j.c
+23
-9
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_k.c
...c/functionalext/sigchain/sigchain_add_special_handler_k.c
+23
-9
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_l.c
...c/functionalext/sigchain/sigchain_add_special_handler_l.c
+22
-8
libc-test/src/functionalext/sigchain/sigchain_call_special_handler_a.c
.../functionalext/sigchain/sigchain_call_special_handler_a.c
+7
-3
libc-test/src/functionalext/sigchain/sigchain_intercept_sigaction_a.c
...c/functionalext/sigchain/sigchain_intercept_sigaction_a.c
+5
-0
libc-test/src/functionalext/sigchain/sigchain_intercept_sigaction_b.c
...c/functionalext/sigchain/sigchain_intercept_sigaction_b.c
+12
-3
libc-test/src/functionalext/sigchain/sigchain_intercept_sigaction_c.c
...c/functionalext/sigchain/sigchain_intercept_sigaction_c.c
+11
-3
libc-test/src/functionalext/sigchain/sigchain_intercept_sigaction_d.c
...c/functionalext/sigchain/sigchain_intercept_sigaction_d.c
+7
-4
libc-test/src/functionalext/sigchain/sigchain_intercept_signal_a.c
.../src/functionalext/sigchain/sigchain_intercept_signal_a.c
+5
-0
libc-test/src/functionalext/sigchain/sigchain_intercept_signal_b.c
.../src/functionalext/sigchain/sigchain_intercept_signal_b.c
+11
-3
libc-test/src/functionalext/sigchain/sigchain_intercept_signal_c.c
.../src/functionalext/sigchain/sigchain_intercept_signal_c.c
+11
-3
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_a.c
...functionalext/sigchain/sigchain_intercept_sigprocmask_a.c
+4
-0
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_b.c
...functionalext/sigchain/sigchain_intercept_sigprocmask_b.c
+17
-0
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_c.c
...functionalext/sigchain/sigchain_intercept_sigprocmask_c.c
+15
-0
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_d.c
...functionalext/sigchain/sigchain_intercept_sigprocmask_d.c
+26
-44
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_e.c
...functionalext/sigchain/sigchain_intercept_sigprocmask_e.c
+9
-3
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_g.c
...functionalext/sigchain/sigchain_intercept_sigprocmask_g.c
+76
-0
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_a.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_a.c
+3
-0
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_b.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_b.c
+9
-3
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_c.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_c.c
+9
-3
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_d.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_d.c
+9
-4
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_e.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_e.c
+11
-5
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_f.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_f.c
+10
-4
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_g.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_g.c
+9
-3
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_h.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_h.c
+10
-3
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_i.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_i.c
+10
-3
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_j.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_j.c
+13
-3
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_k.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_k.c
+13
-0
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_l.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_l.c
+13
-0
libc-test/src/functionalext/sigchain/test_src_functionalext_sigchain.gni
...unctionalext/sigchain/test_src_functionalext_sigchain.gni
+1
-0
porting/linux/user/src/signal/sigprocmask.c
porting/linux/user/src/signal/sigprocmask.c
+22
-1
未找到文件。
libc-test/src/functionalext/common/sigchain_util.h
浏览文件 @
83f800ab
...
...
@@ -32,6 +32,8 @@
#define SIGCHIAN_TEST_SIGNAL_NUM_1 1
#define SIGCHIAN_TEST_SIGNAL_NUM_2 2
#define SIGCHIAN_TEST_SIGNAL_NUM_3 3
#define SIGCHIAN_TEST_SIGNAL_NUM_4 4
#define SIGCHIAN_TEST_SIGNAL_NUM_10 10
#define SIGCHAIN_SIGNAL_37 37
...
...
@@ -39,4 +41,6 @@
#define SIGCHAIN_SIGNAL_50 50
#define SIGCHAIN_SIGNAL_56 56
#define SIGCHAIN_SIGNAL_64 64
#define SIGCHAIN_SIGNAL_65 65
\ No newline at end of file
#define SIGCHAIN_SIGNAL_65 65
extern
bool
get_sigchain_mask_enable
();
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_a.c
浏览文件 @
83f800ab
...
...
@@ -20,12 +20,14 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_001"
,
signo
,
SIGSEGV
);
g_count
++
;
return
true
;
}
...
...
@@ -44,14 +46,17 @@ static void sigchain_add_special_handler_001()
};
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGSEGV
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_001"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGSEGV
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_001"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
}
}
int
main
(
void
)
{
sigchain_add_special_handler_001
();
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_add_special_handler_001"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_b.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_002"
,
signo
,
SIGSEGV
);
return
false
;
}
...
...
@@ -34,6 +36,8 @@ static bool sigchain_special_handler(int signo, siginfo_t *siginfo, void *uconte
*/
static
void
signal_handler
(
int
signo
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_002"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_002"
,
signo
,
SIGSEGV
);
return
;
}
...
...
@@ -54,15 +58,18 @@ static void sigchain_add_special_handler_002()
.
sca_flags
=
0
,
};
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGSEGV
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGSEGV
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
}
}
int
main
(
void
)
{
sigchain_add_special_handler_002
();
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_add_special_handler_002"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_c.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_003"
,
signo
,
SIGSEGV
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler(int signo, siginfo_t *siginfo, void *uconte
*/
static
void
signal_sigaction
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_003"
,
signo
,
SIGSEGV
);
}
...
...
@@ -57,14 +60,17 @@ static void sigchain_add_special_handler_003()
};
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGSEGV
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_003"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGSEGV
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_003"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
}
}
int
main
(
void
)
{
sigchain_add_special_handler_003
();
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_add_special_handler_003"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_d.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_004"
,
signo
,
SIGABRT
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_004"
,
signo
,
SIGABRT
);
return
true
;
}
...
...
@@ -60,15 +63,17 @@ static void sigchain_add_special_handler_004()
};
add_special_signal_handler
(
SIGABRT
,
&
sigabrt1
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGABRT
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_001"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGABRT
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_004"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
}
}
int
main
(
void
)
{
sigchain_add_special_handler_004
();
raise
(
SIGABRT
);
raise
(
SIGABRT
);
EXPECT_EQ
(
"sigchain_add_special_handler_004"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_e.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_005"
,
signo
,
SIGABRT
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_005"
,
signo
,
SIGABRT
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler2(int signo, siginfo_t *siginfo, void *ucont
*/
static
void
signal_handler
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_005"
,
signo
,
SIGABRT
);
}
...
...
@@ -54,7 +58,7 @@ static void signal_handler(int signo)
*/
static
void
sigchain_add_special_handler_005
()
{
signal
(
SIG
SEGV
,
signal_handler
);
signal
(
SIG
ABRT
,
signal_handler
);
struct
signal_chain_action
sigabrt
=
{
.
sca_sigaction
=
sigchain_special_handler1
,
...
...
@@ -69,16 +73,18 @@ static void sigchain_add_special_handler_005()
.
sca_flags
=
0
,
};
add_special_signal_handler
(
SIGABRT
,
&
sigabrt1
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGABRT
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_001"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGABRT
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_005"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
}
}
int
main
(
void
)
{
sigchain_add_special_handler_005
();
raise
(
SIGABRT
);
raise
(
SIGABRT
);
EXPECT_EQ
(
"sigchain_add_special_handler_005"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_3
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_f.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_006"
,
signo
,
SIGABRT
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_006"
,
signo
,
SIGABRT
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler2(int signo, siginfo_t *siginfo, void *ucont
*/
static
void
signal_sigaction
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_006"
,
signo
,
SIGABRT
);
}
...
...
@@ -73,15 +77,17 @@ static void sigchain_add_special_handler_006()
};
add_special_signal_handler
(
SIGABRT
,
&
sigabrt2
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGABRT
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_001"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGABRT
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_006"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
}
}
int
main
(
void
)
{
sigchain_add_special_handler_006
();
raise
(
SIGABRT
);
raise
(
SIGABRT
);
EXPECT_EQ
(
"sigchain_add_special_handler_006"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_3
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_g.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_007"
,
signo
,
SIGSEGV
);
return
true
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_007"
,
signo
,
SIGHUP
);
return
true
;
}
...
...
@@ -60,15 +63,19 @@ static void sigchain_add_special_handler_007()
};
add_special_signal_handler
(
SIGHUP
,
&
sighup
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_007"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_007"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
}
}
int
main
(
void
)
{
sigchain_add_special_handler_007
();
raise
(
SIGHUP
);
EXPECT_EQ
(
"sigchain_add_special_handler_007"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_add_special_handler_007"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_h.c
浏览文件 @
83f800ab
...
...
@@ -20,12 +20,19 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
#define SIGCHAIN_CALL_SPECIAL_HANDLER1 1
#define SIGCHAIN_CALL_SPECIAL_HANDLER2 2
#define SIGCHAIN_CALL_HANDLER_SIGSEGV 4
#define SIGCHAIN_CALL_HANDLER_SIGUP 8
#define SIGCHAIN_CALL_CHECK_NUM 7
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_008"
,
signo
,
SIGSEGV
);
g_count
+=
SIGCHAIN_CALL_SPECIAL_HANDLER1
;
return
false
;
}
...
...
@@ -35,7 +42,8 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_008"
,
signo
,
SIGHUP
);
return
false
;
g_count
+=
SIGCHAIN_CALL_SPECIAL_HANDLER2
;
return
true
;
}
/**
...
...
@@ -44,8 +52,10 @@ static bool sigchain_special_handler2(int signo, siginfo_t *siginfo, void *ucont
static
void
signal_handler
(
int
signo
)
{
if
(
signo
==
SIGHUP
)
{
g_count
+=
SIGCHAIN_CALL_HANDLER_SIGUP
;
EXPECT_EQ
(
"sigchain_add_special_handler_008"
,
signo
,
SIGHUP
);
}
else
{
g_count
+=
SIGCHAIN_CALL_HANDLER_SIGSEGV
;
EXPECT_EQ
(
"sigchain_add_special_handler_008"
,
signo
,
SIGSEGV
);
}
}
...
...
@@ -59,6 +69,7 @@ static void signal_handler(int signo)
static
void
sigchain_add_special_handler_008
()
{
signal
(
SIGSEGV
,
signal_handler
);
signal
(
SIGHUP
,
signal_handler
);
struct
signal_chain_action
sigsegv
=
{
.
sca_sigaction
=
sigchain_special_handler1
,
...
...
@@ -74,9 +85,11 @@ static void sigchain_add_special_handler_008()
};
add_special_signal_handler
(
SIGHUP
,
&
sighup
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_008"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_008"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
}
}
int
main
(
void
)
...
...
@@ -84,5 +97,6 @@ int main(void)
sigchain_add_special_handler_008
();
raise
(
SIGHUP
);
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_add_special_handler_008"
,
g_count
,
SIGCHAIN_CALL_CHECK_NUM
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_i.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_009"
,
signo
,
SIGSEGV
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_009"
,
signo
,
SIGHUP
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler2(int signo, siginfo_t *siginfo, void *ucont
*/
static
void
signal_sigaction
(
int
signo
)
{
g_count
++
;
if
(
signo
==
SIGHUP
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_009"
,
signo
,
SIGHUP
);
}
else
{
...
...
@@ -63,6 +67,11 @@ static void sigchain_add_special_handler_009()
};
sigaction
(
SIGSEGV
,
&
sigac
,
NULL
);
struct
sigaction
sigac1
=
{
.
sa_handler
=
signal_sigaction
,
};
sigaction
(
SIGHUP
,
&
sigac1
,
NULL
);
struct
signal_chain_action
sigsegv
=
{
.
sca_sigaction
=
sigchain_special_handler1
,
.
sca_mask
=
{},
...
...
@@ -77,15 +86,19 @@ static void sigchain_add_special_handler_009()
};
add_special_signal_handler
(
SIGHUP
,
&
sighup
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_009"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_009"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
}
}
int
main
(
void
)
{
sigchain_add_special_handler_009
();
raise
(
SIGHUP
);
EXPECT_EQ
(
"sigchain_add_special_handler_009"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_add_special_handler_009"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_4
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_j.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
SIGHUP
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
SIGABRT
);
return
true
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler2(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler3
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
SIGSEGV
);
return
true
;
}
...
...
@@ -52,6 +56,7 @@ static bool sigchain_special_handler3(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler4
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
SIGURG
);
return
false
;
}
...
...
@@ -61,6 +66,7 @@ static bool sigchain_special_handler4(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler5
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
SIGSYS
);
return
true
;
}
...
...
@@ -70,6 +76,7 @@ static bool sigchain_special_handler5(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler6
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
SIGCHAIN_SIGNAL_37
);
return
false
;
}
...
...
@@ -79,6 +86,7 @@ static bool sigchain_special_handler6(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler7
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
SIGCHAIN_SIGNAL_43
);
return
false
;
}
...
...
@@ -88,6 +96,7 @@ static bool sigchain_special_handler7(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler8
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
SIGCHAIN_SIGNAL_50
);
return
false
;
}
...
...
@@ -97,6 +106,7 @@ static bool sigchain_special_handler8(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler9
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
SIGCHAIN_SIGNAL_56
);
return
false
;
}
...
...
@@ -106,6 +116,7 @@ static bool sigchain_special_handler9(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler10
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
SIGCHAIN_SIGNAL_64
);
return
false
;
}
...
...
@@ -188,15 +199,17 @@ static void sigchain_add_special_handler_010()
};
add_special_signal_handler
(
SIGCHAIN_SIGNAL_64
,
&
sig64
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_10
]
=
{
SIGHUP
,
SIGABRT
,
SIGSEGV
,
SIGURG
,
SIGSYS
,
SIGCHAIN_SIGNAL_37
,
SIGCHAIN_SIGNAL_43
,
SIGCHAIN_SIGNAL_50
,
SIGCHAIN_SIGNAL_56
,
SIGCHAIN_SIGNAL_64
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_010"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_10
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_10
]
=
{
SIGHUP
,
SIGABRT
,
SIGSEGV
,
SIGURG
,
SIGSYS
,
SIGCHAIN_SIGNAL_37
,
SIGCHAIN_SIGNAL_43
,
SIGCHAIN_SIGNAL_50
,
SIGCHAIN_SIGNAL_56
,
SIGCHAIN_SIGNAL_64
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_010"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_10
);
}
}
int
main
(
void
)
...
...
@@ -212,5 +225,6 @@ int main(void)
raise
(
SIGCHAIN_SIGNAL_50
);
raise
(
SIGCHAIN_SIGNAL_56
);
raise
(
SIGCHAIN_SIGNAL_64
);
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_10
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_k.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGHUP
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGABRT
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler2(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler3
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGSEGV
);
return
false
;
}
...
...
@@ -52,6 +56,7 @@ static bool sigchain_special_handler3(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler4
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGURG
);
return
false
;
}
...
...
@@ -61,6 +66,7 @@ static bool sigchain_special_handler4(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler5
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGSYS
);
return
false
;
}
...
...
@@ -70,6 +76,7 @@ static bool sigchain_special_handler5(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler6
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_37
);
return
false
;
}
...
...
@@ -79,6 +86,7 @@ static bool sigchain_special_handler6(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler7
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_43
);
return
false
;
}
...
...
@@ -88,6 +96,7 @@ static bool sigchain_special_handler7(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler8
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_50
);
return
false
;
}
...
...
@@ -97,6 +106,7 @@ static bool sigchain_special_handler8(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler9
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_56
);
return
false
;
}
...
...
@@ -106,6 +116,7 @@ static bool sigchain_special_handler9(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler10
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_64
);
return
false
;
}
...
...
@@ -227,15 +238,17 @@ static void sigchain_add_special_handler_011()
};
add_special_signal_handler
(
SIGCHAIN_SIGNAL_64
,
&
sig64
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_10
]
=
{
SIGHUP
,
SIGABRT
,
SIGSEGV
,
SIGURG
,
SIGSYS
,
SIGCHAIN_SIGNAL_37
,
SIGCHAIN_SIGNAL_43
,
SIGCHAIN_SIGNAL_50
,
SIGCHAIN_SIGNAL_56
,
SIGCHAIN_SIGNAL_64
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_011"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_10
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_10
]
=
{
SIGHUP
,
SIGABRT
,
SIGSEGV
,
SIGURG
,
SIGSYS
,
SIGCHAIN_SIGNAL_37
,
SIGCHAIN_SIGNAL_43
,
SIGCHAIN_SIGNAL_50
,
SIGCHAIN_SIGNAL_56
,
SIGCHAIN_SIGNAL_64
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_011"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_10
);
}
}
int
main
(
void
)
...
...
@@ -251,5 +264,6 @@ int main(void)
raise
(
SIGCHAIN_SIGNAL_50
);
raise
(
SIGCHAIN_SIGNAL_56
);
raise
(
SIGCHAIN_SIGNAL_64
);
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_10
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_l.c
浏览文件 @
83f800ab
...
...
@@ -21,11 +21,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGHUP
);
return
false
;
}
...
...
@@ -35,6 +37,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGABRT
);
return
false
;
}
...
...
@@ -44,6 +47,7 @@ static bool sigchain_special_handler2(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler3
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGSEGV
);
return
false
;
}
...
...
@@ -53,6 +57,7 @@ static bool sigchain_special_handler3(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler4
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGURG
);
return
false
;
}
...
...
@@ -62,6 +67,7 @@ static bool sigchain_special_handler4(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler5
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGSYS
);
return
false
;
}
...
...
@@ -71,6 +77,7 @@ static bool sigchain_special_handler5(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler6
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_37
);
return
false
;
}
...
...
@@ -80,6 +87,7 @@ static bool sigchain_special_handler6(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler7
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_43
);
return
false
;
}
...
...
@@ -89,6 +97,7 @@ static bool sigchain_special_handler7(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler8
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_50
);
return
false
;
}
...
...
@@ -98,6 +107,7 @@ static bool sigchain_special_handler8(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler9
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_56
);
return
false
;
}
...
...
@@ -107,6 +117,7 @@ static bool sigchain_special_handler9(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler10
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_64
);
return
false
;
}
...
...
@@ -267,14 +278,16 @@ static void sigchain_add_special_handler_012()
};
add_special_signal_handler
(
SIGCHAIN_SIGNAL_64
,
&
sig64
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_10
]
=
{
SIGHUP
,
SIGABRT
,
SIGSEGV
,
SIGURG
,
SIGSYS
,
SIGCHAIN_SIGNAL_37
,
SIGCHAIN_SIGNAL_43
,
SIGCHAIN_SIGNAL_50
,
SIGCHAIN_SIGNAL_56
,
SIGCHAIN_SIGNAL_64
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_012"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_10
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_10
]
=
{
SIGHUP
,
SIGABRT
,
SIGSEGV
,
SIGURG
,
SIGSYS
,
SIGCHAIN_SIGNAL_37
,
SIGCHAIN_SIGNAL_43
,
SIGCHAIN_SIGNAL_50
,
SIGCHAIN_SIGNAL_56
,
SIGCHAIN_SIGNAL_64
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_012"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_10
);
}
}
int
main
(
void
)
...
...
@@ -290,5 +303,6 @@ int main(void)
raise
(
SIGCHAIN_SIGNAL_50
);
raise
(
SIGCHAIN_SIGNAL_56
);
raise
(
SIGCHAIN_SIGNAL_64
);
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_10
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_call_special_handler_a.c
浏览文件 @
83f800ab
...
...
@@ -40,6 +40,7 @@ static void signal_handler(int signo)
{
EXPECT_EQ
(
"sigchain_call_special_handler_001"
,
signo
,
SIGSEGV
);
EXPECT_EQ
(
"sigchain_call_special_handler_001"
,
g_count
,
SIGCHAIN_CALL_SPECIAL_HANDLER_TAG
);
g_count
++
;
return
;
}
...
...
@@ -60,14 +61,17 @@ static void sigchain_call_special_handler_001()
};
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGSEGV
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_call_special_handler_001"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGSEGV
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_call_special_handler_001"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
}
}
int
main
(
void
)
{
sigchain_call_special_handler_001
();
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_call_special_handler_001"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_intercept_sigaction_a.c
浏览文件 @
83f800ab
...
...
@@ -18,12 +18,15 @@
#include <stdlib.h>
#include "test.h"
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
void
signal_handler1
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigaction_001"
,
signo
,
SIGHUP
);
}
...
...
@@ -32,6 +35,7 @@ static void signal_handler1(int signo)
*/
static
void
signal_handler2
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigaction_001"
,
signo
,
SIGSEGV
);
}
...
...
@@ -59,5 +63,6 @@ int main(void)
sigchain_intercept_sigaction_001
();
raise
(
SIGHUP
);
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_intercept_sigaction_001"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_intercept_sigaction_b.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigaction_002"
,
signo
,
SIGHUP
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler(int signo, siginfo_t *siginfo, void *uconte
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigaction_002"
,
signo
,
SIGSEGV
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
void
signal_handler1
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigaction_002"
,
signo
,
SIGHUP
);
}
...
...
@@ -51,6 +55,7 @@ static void signal_handler1(int signo)
*/
static
void
signal_handler2
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigaction_002"
,
signo
,
SIGSEGV
);
}
...
...
@@ -86,15 +91,19 @@ static void sigchain_intercept_sigaction_002()
};
sigaction
(
SIGSEGV
,
&
siga2
,
NULL
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigaction_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigaction_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
}
}
int
main
(
void
)
{
sigchain_intercept_sigaction_002
();
raise
(
SIGHUP
);
EXPECT_EQ
(
"sigchain_intercept_sigaction_002"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_intercept_sigaction_002"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_4
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_intercept_sigaction_c.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigaction_003"
,
signo
,
SIGHUP
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler(int signo, siginfo_t *siginfo, void *uconte
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigaction_003"
,
signo
,
SIGSEGV
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
void
signal_handler1
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigaction_003"
,
signo
,
SIGHUP
);
}
...
...
@@ -51,6 +55,7 @@ static void signal_handler1(int signo)
*/
static
void
signal_handler2
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigaction_003"
,
signo
,
SIGSEGV
);
}
...
...
@@ -86,9 +91,11 @@ static void sigchain_intercept_sigaction_003()
};
sigaction
(
SIGSEGV
,
&
siga2
,
NULL
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigaction_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigaction_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
}
remove_special_signal_handler
(
SIGHUP
,
sigchain_special_handler
);
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler1
);
...
...
@@ -99,5 +106,6 @@ int main(void)
sigchain_intercept_sigaction_003
();
raise
(
SIGHUP
);
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_intercept_sigaction_003"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_intercept_sigaction_d.c
浏览文件 @
83f800ab
...
...
@@ -20,16 +20,17 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
void
signal_handler1
(
int
signo
)
{
EXPECT_EQ
(
"sigchain_intercept_sigaction_00
1
"
,
signo
,
SIGHUP
);
EXPECT_EQ
(
"sigchain_intercept_sigaction_00
4
"
,
signo
,
SIGHUP
);
sigset_t
set
=
{
0
};
int
signal
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigaction_00
2
"
,
signal
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigaction_00
4
"
,
signal
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
g_count
++
;
raise
(
SIGSEGV
);
}
...
...
@@ -38,7 +39,8 @@ static void signal_handler1(int signo)
*/
static
void
signal_handler2
(
int
signo
)
{
EXPECT_EQ
(
"sigchain_intercept_sigaction_001"
,
signo
,
SIGSEGV
);
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigaction_004"
,
signo
,
SIGSEGV
);
}
/**
...
...
@@ -64,5 +66,6 @@ int main(void)
{
sigchain_intercept_sigaction_004
();
raise
(
SIGHUP
);
EXPECT_EQ
(
"sigchain_intercept_sigaction_004"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_intercept_signal_a.c
浏览文件 @
83f800ab
...
...
@@ -18,12 +18,15 @@
#include <stdlib.h>
#include "test.h"
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the signal handler
*/
static
void
signal_handler1
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_signal_001"
,
signo
,
SIGHUP
);
}
...
...
@@ -32,6 +35,7 @@ static void signal_handler1(int signo)
*/
static
void
signal_handler2
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_signal_001"
,
signo
,
SIGSEGV
);
}
...
...
@@ -52,5 +56,6 @@ int main(void)
sigchain_intercept_signal_001
();
raise
(
SIGHUP
);
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_intercept_sigaction_001"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_intercept_signal_b.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_signal_002"
,
signo
,
SIGHUP
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler(int signo, siginfo_t *siginfo, void *uconte
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_signal_002"
,
signo
,
SIGSEGV
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
void
signal_handler1
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_signal_002"
,
signo
,
SIGHUP
);
}
...
...
@@ -51,6 +55,7 @@ static void signal_handler1(int signo)
*/
static
void
signal_handler2
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_signal_002"
,
signo
,
SIGSEGV
);
}
...
...
@@ -79,9 +84,11 @@ static void sigchain_intercept_signal_002()
signal
(
SIGHUP
,
signal_handler1
);
signal
(
SIGSEGV
,
signal_handler2
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_signal_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_signal_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
}
}
int
main
(
void
)
...
...
@@ -89,5 +96,6 @@ int main(void)
sigchain_intercept_signal_002
();
raise
(
SIGHUP
);
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_intercept_signal_002"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_4
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_intercept_signal_c.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_signal_003"
,
signo
,
SIGHUP
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler(int signo, siginfo_t *siginfo, void *uconte
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_signal_003"
,
signo
,
SIGSEGV
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
void
signal_handler1
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_signal_003"
,
signo
,
SIGHUP
);
}
...
...
@@ -51,6 +55,7 @@ static void signal_handler1(int signo)
*/
static
void
signal_handler2
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_signal_003"
,
signo
,
SIGSEGV
);
}
...
...
@@ -82,9 +87,11 @@ static void sigchain_intercept_signal_003()
remove_special_signal_handler
(
SIGHUP
,
sigchain_special_handler
);
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler1
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigaction_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigaction_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
}
}
int
main
(
void
)
...
...
@@ -92,5 +99,6 @@ int main(void)
sigchain_intercept_signal_003
();
raise
(
SIGHUP
);
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_intercept_signal_003"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_a.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the signal handler
*/
static
void
signal_handler1
(
int
signo
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_intercept_sigprocmask_001"
,
true
);
}
...
...
@@ -33,6 +35,7 @@ static void signal_handler1(int signo)
*/
static
void
signal_handler2
(
int
signo
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_intercept_sigprocmask_001"
,
true
);
}
...
...
@@ -64,5 +67,6 @@ int main(void)
sigchain_intercept_sigprocmask_001
();
raise
(
SIGHUP
);
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_001"
,
g_count
,
0
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_b.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_002"
,
signo
,
SIGHUP
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler(int signo, siginfo_t *siginfo, void *uconte
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_002"
,
signo
,
SIGSEGV
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
void
signal_handler1
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_002"
,
signo
,
SIGHUP
);
}
...
...
@@ -51,6 +55,7 @@ static void signal_handler1(int signo)
*/
static
void
signal_handler2
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_002"
,
signo
,
SIGSEGV
);
}
...
...
@@ -95,6 +100,18 @@ int main(void)
{
sigchain_intercept_sigprocmask_002
();
raise
(
SIGHUP
);
if
(
get_sigchain_mask_enable
())
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_002"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
}
else
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_002"
,
g_count
,
0
);
}
raise
(
SIGSEGV
);
if
(
get_sigchain_mask_enable
())
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_002"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_4
);
}
else
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_002"
,
g_count
,
0
);
}
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_c.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_intercept_sigprocmask_003"
,
true
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler(int signo, siginfo_t *siginfo, void *uconte
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_intercept_sigprocmask_003"
,
true
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
void
signal_handler1
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_003"
,
signo
,
SIGHUP
);
}
...
...
@@ -51,6 +55,7 @@ static void signal_handler1(int signo)
*/
static
void
signal_handler2
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_003"
,
signo
,
SIGSEGV
);
}
...
...
@@ -98,6 +103,16 @@ int main(void)
{
sigchain_intercept_sigprocmask_003
();
raise
(
SIGHUP
);
if
(
get_sigchain_mask_enable
())
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_003"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
}
else
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_003"
,
g_count
,
0
);
}
raise
(
SIGSEGV
);
if
(
get_sigchain_mask_enable
())
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_003"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
}
else
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_003"
,
g_count
,
0
);
}
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_d.c
浏览文件 @
83f800ab
...
...
@@ -21,39 +21,25 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_004"
,
signo
,
SIGHUP
)
;
g_count
++
;
return
false
;
}
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_004"
,
signo
,
SIGHUP
);
return
false
;
}
/**
* @brief the signal handler
*/
static
void
signal_handler
1
(
int
signo
)
static
void
signal_handler
(
int
signo
)
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_004"
,
signo
,
SIGHUP
)
;
g_count
++
;
}
/**
* @brief the signal handler
*/
static
void
signal_handler2
(
int
signo
)
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_004"
,
signo
,
SIGSEGV
);
}
/**
* @tc.name : sigchain_intercept_sigprocmask_004
...
...
@@ -61,50 +47,46 @@ static void signal_handler2(int signo)
* the special handler, and the case is called by multiple threads
* @tc.level : Level 0
*/
static
void
sigchain_intercept_sigprocmask_004
()
static
void
sigchain_intercept_sigprocmask_004
(
int
signo
)
{
struct
sigaction
siga
1
=
{
.
sa_handler
=
signal_handler
1
,
struct
sigaction
siga
=
{
.
sa_handler
=
signal_handler
,
};
sigaction
(
SIGHUP
,
&
siga1
,
NULL
);
sigaction
(
signo
,
&
siga
,
NULL
);
struct
sigaction
siga2
=
{
.
sa_handler
=
signal_handler2
,
};
sigaction
(
SIGSEGV
,
&
siga2
,
NULL
);
struct
signal_chain_action
sighup
=
{
struct
signal_chain_action
sig_ca
=
{
.
sca_sigaction
=
sigchain_special_handler
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
SIGHUP
,
&
sighup
);
add_special_signal_handler
(
signo
,
&
sig_ca
);
struct
signal_chain_action
sigsegv
=
{
.
sca_sigaction
=
sigchain_special_handler1
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
}
;
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signal
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
signo
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigprocmask_004"
,
signal
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
}
}
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGHUP
,
SIGSEGV
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigprocmask_004"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
void
thread_func1
(
void
*
data
)
{
sigchain_intercept_sigprocmask_004
(
SIGHUP
);
}
void
thread_func
(
void
*
data
)
void
thread_func
2
(
void
*
data
)
{
sigchain_intercept_sigprocmask_004
();
raise
(
SIGHUP
);
raise
(
SIGSEGV
);
sigchain_intercept_sigprocmask_004
(
SIGSEGV
);
}
int
main
(
void
)
{
thrd_t
t1
,
t2
;
thrd_create
(
&
t1
,
(
thrd_start_t
)
thread_func
,
NULL
);
thrd_create
(
&
t2
,
(
thrd_start_t
)
thread_func
,
NULL
);
thrd_create
(
&
t1
,
(
thrd_start_t
)
thread_func
1
,
NULL
);
thrd_create
(
&
t2
,
(
thrd_start_t
)
thread_func
2
,
NULL
);
thrd_join
(
t1
,
NULL
);
thrd_join
(
t2
,
NULL
);
raise
(
SIGHUP
);
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_004"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_4
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_e.c
浏览文件 @
83f800ab
...
...
@@ -35,7 +35,7 @@ static bool sigchain_special_handler(int signo, siginfo_t *siginfo, void *uconte
raise
(
SIGSEGV
);
g_count
++
;
}
return
fals
e
;
return
tru
e
;
}
/**
...
...
@@ -44,7 +44,7 @@ static bool sigchain_special_handler(int signo, siginfo_t *siginfo, void *uconte
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_005"
,
signo
,
SIGSEGV
);
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_005"
,
g_count
,
1
);
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_005"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_
1
);
return
false
;
}
...
...
@@ -54,6 +54,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
void
signal_handler
(
int
signo
)
{
g_count
++
;
EXPECT_TRUE
(
"sigchain_intercept_sigprocmask_005"
,
true
);
}
...
...
@@ -92,12 +93,17 @@ static void sigchain_intercept_sigprocmask_005()
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGHUP
,
SIGSEGV
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigprocmask_00
1
"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigprocmask_00
5
"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
}
int
main
(
void
)
{
sigchain_intercept_sigprocmask_005
();
raise
(
SIGHUP
);
if
(
get_sigchain_mask_enable
())
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_005"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
}
else
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_005"
,
g_count
,
0
);
}
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_g.c
0 → 100644
浏览文件 @
83f800ab
/*
* Copyright (c) 2023 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.
*/
#include <sigchain.h>
#include <wchar.h>
#include <stdlib.h>
#include "test.h"
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_007"
,
signo
,
SIGSEGV
);
return
false
;
}
/**
* @brief the signal handler
*/
static
void
signal_handler
(
int
signo
)
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_007"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
g_count
++
;
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_007"
,
signo
,
SIGSEGV
);
return
;
}
/**
* @tc.name : sigchain_intercept_sigprocmask_007
* @tc.desc : Test sigprocmask when the 'musl.sigchain.procmask' is false,
* @tc.level : Level 0
*/
static
void
sigchain_intercept_sigprocmask_007
()
{
signal
(
SIGSEGV
,
signal_handler
);
struct
signal_chain_action
sigsegv
=
{
.
sca_sigaction
=
sigchain_special_handler
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGSEGV
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigprocmask_007"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
}
int
main
(
void
)
{
sigchain_intercept_sigprocmask_007
();
raise
(
SIGSEGV
);
if
(
get_sigchain_mask_enable
())
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_007"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
}
else
{
EXPECT_EQ
(
"sigchain_intercept_sigprocmask_007"
,
g_count
,
0
);
}
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_a.c
浏览文件 @
83f800ab
...
...
@@ -19,11 +19,13 @@
#include "test.h"
#include "functionalext.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_001"
,
true
);
return
false
;
}
...
...
@@ -50,5 +52,6 @@ int main(void)
{
sigchain_rm_special_handler_001
();
raise
(
SIGHUP
);
EXPECT_EQ
(
"sigchain_rm_special_handler_001"
,
g_count
,
0
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_b.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_002"
,
true
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler(int signo, siginfo_t *siginfo, void *uconte
*/
static
void
signal_handler
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_rm_special_handler_002"
,
signo
,
SIGSEGV
);
}
...
...
@@ -54,9 +57,11 @@ static void sigchain_rm_special_handler_002()
};
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGSEGV
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGSEGV
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
}
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler
);
}
...
...
@@ -65,5 +70,6 @@ int main(void)
{
sigchain_rm_special_handler_002
();
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_rm_special_handler_002"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_c.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_003"
,
true
);
return
true
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler(int signo, siginfo_t *siginfo, void *uconte
*/
static
void
signal_sigaction
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_rm_special_handler_003"
,
signo
,
SIGSEGV
);
}
...
...
@@ -57,9 +60,11 @@ static void sigchain_rm_special_handler_003()
};
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGSEGV
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_003"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGSEGV
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_003"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
}
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler
);
}
...
...
@@ -68,5 +73,6 @@ int main(void)
{
sigchain_rm_special_handler_003
();
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_rm_special_handler_003"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_d.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_004"
,
true
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_004"
,
true
);
return
false
;
}
...
...
@@ -60,9 +63,11 @@ static void sigchain_rm_special_handler_004()
};
add_special_signal_handler
(
SIGABRT
,
&
sigabrt1
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGABRT
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_004"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGABRT
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_004"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
}
remove_special_signal_handler
(
SIGABRT
,
sigchain_special_handler2
);
remove_special_signal_handler
(
SIGABRT
,
sigchain_special_handler1
);
...
...
@@ -72,6 +77,6 @@ int main(void)
{
sigchain_rm_special_handler_004
();
raise
(
SIGABRT
);
raise
(
SIGABRT
);
EXPECT_EQ
(
"sigchain_rm_special_handler_004"
,
g_count
,
0
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_e.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_005"
,
true
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_005"
,
true
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler2(int signo, siginfo_t *siginfo, void *ucont
*/
static
void
signal_handler
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_rm_special_handler_005"
,
signo
,
SIGABRT
);
}
...
...
@@ -70,10 +74,12 @@ static void sigchain_rm_special_handler_005()
};
add_special_signal_handler
(
SIGABRT
,
&
sigabrt1
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGABRT
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_005"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGABRT
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_005"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
}
remove_special_signal_handler
(
SIGABRT
,
sigchain_special_handler2
);
remove_special_signal_handler
(
SIGABRT
,
sigchain_special_handler1
);
}
...
...
@@ -82,6 +88,6 @@ int main(void)
{
sigchain_rm_special_handler_005
();
raise
(
SIGABRT
);
raise
(
SIGABRT
);
EXPECT_EQ
(
"sigchain_rm_special_handler_005"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_f.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_006"
,
true
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_006"
,
true
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler2(int signo, siginfo_t *siginfo, void *ucont
*/
static
void
signal_sigaction
(
int
signo
)
{
g_count
++
;
EXPECT_EQ
(
"sigchain_rm_special_handler_006"
,
signo
,
SIGABRT
);
}
...
...
@@ -73,9 +77,11 @@ static void sigchain_rm_special_handler_006()
};
add_special_signal_handler
(
SIGABRT
,
&
sigabrt2
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGABRT
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_006"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_1
]
=
{
SIGABRT
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_006"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
}
remove_special_signal_handler
(
SIGABRT
,
sigchain_special_handler2
);
remove_special_signal_handler
(
SIGABRT
,
sigchain_special_handler1
);
...
...
@@ -85,6 +91,6 @@ int main(void)
{
sigchain_rm_special_handler_006
();
raise
(
SIGABRT
);
raise
(
SIGABRT
);
EXPECT_EQ
(
"sigchain_rm_special_handler_006"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_1
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_g.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_007"
,
true
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_007"
,
true
);
return
false
;
}
...
...
@@ -60,9 +63,11 @@ static void sigchain_rm_special_handler_007()
};
add_special_signal_handler
(
SIGHUP
,
&
sighup
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGCHAIN_SIGNAL_64
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_007"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGCHAIN_SIGNAL_64
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_007"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
}
remove_special_signal_handler
(
SIGHUP
,
sigchain_special_handler2
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_64
,
sigchain_special_handler1
);
...
...
@@ -73,5 +78,6 @@ int main(void)
sigchain_rm_special_handler_007
();
raise
(
SIGHUP
);
raise
(
SIGCHAIN_SIGNAL_64
);
EXPECT_EQ
(
"sigchain_rm_special_handler_007"
,
g_count
,
0
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_h.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_008"
,
true
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_008"
,
true
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler2(int signo, siginfo_t *siginfo, void *ucont
*/
static
void
signal_handler
(
int
signo
)
{
g_count
++
;
if
(
signo
==
SIGHUP
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_008"
,
signo
,
SIGHUP
);
}
else
{
...
...
@@ -75,9 +79,11 @@ static void sigchain_rm_special_handler_008()
};
add_special_signal_handler
(
SIGHUP
,
&
sighup
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_008"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_008"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
}
remove_special_signal_handler
(
SIGHUP
,
sigchain_special_handler2
);
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler1
);
...
...
@@ -88,5 +94,6 @@ int main(void)
sigchain_rm_special_handler_008
();
raise
(
SIGHUP
);
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_rm_special_handler_008"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_i.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_009"
,
true
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_009"
,
true
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler2(int signo, siginfo_t *siginfo, void *ucont
*/
static
void
signal_sigaction
(
int
signo
)
{
g_count
++
;
if
(
signo
==
SIGHUP
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_009"
,
signo
,
SIGHUP
);
}
else
{
...
...
@@ -82,9 +86,11 @@ static void sigchain_rm_special_handler_009()
};
add_special_signal_handler
(
SIGHUP
,
&
sighup
);
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_009"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
if
(
get_sigchain_mask_enable
())
{
sigset_t
set
=
{
0
};
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCHAIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_009"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
}
remove_special_signal_handler
(
SIGHUP
,
sigchain_special_handler2
);
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler1
);
...
...
@@ -95,5 +101,6 @@ int main(void)
sigchain_rm_special_handler_009
();
raise
(
SIGHUP
);
raise
(
SIGSEGV
);
EXPECT_EQ
(
"sigchain_rm_special_handler_009"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_2
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_j.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_010"
,
true
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_010"
,
true
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler2(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler3
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_010"
,
true
);
return
false
;
}
...
...
@@ -52,6 +56,7 @@ static bool sigchain_special_handler3(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler4
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_010"
,
true
);
return
false
;
}
...
...
@@ -61,6 +66,7 @@ static bool sigchain_special_handler4(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler5
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_010"
,
true
);
return
false
;
}
...
...
@@ -70,6 +76,7 @@ static bool sigchain_special_handler5(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler6
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_010"
,
true
);
return
false
;
}
...
...
@@ -79,6 +86,7 @@ static bool sigchain_special_handler6(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler7
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_010"
,
true
);
return
false
;
}
...
...
@@ -88,6 +96,7 @@ static bool sigchain_special_handler7(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler8
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_010"
,
true
);
return
false
;
}
...
...
@@ -97,6 +106,7 @@ static bool sigchain_special_handler8(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler9
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_010"
,
true
);
return
false
;
}
...
...
@@ -106,6 +116,7 @@ static bool sigchain_special_handler9(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler10
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_010"
,
true
);
return
false
;
}
...
...
@@ -113,7 +124,7 @@ static bool sigchain_special_handler10(int signo, siginfo_t *siginfo, void *ucon
/**
* @tc.name : sigchain_rm_special_handler_010
* @tc.desc : Remove multiple special handlers for the different signals that are not registered with
* the kernel
in sigchain
.
* the kernel.
* @tc.level : Level 0
*/
static
void
sigchain_rm_special_handler_010
()
...
...
@@ -199,8 +210,6 @@ static void sigchain_rm_special_handler_010()
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_56
,
sigchain_special_handler9
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_64
,
sigchain_special_handler10
);
raise
(
SIGHUP
);
raise
(
SIGURG
);
raise
(
SIGCHAIN_SIGNAL_37
);
raise
(
SIGCHAIN_SIGNAL_43
);
raise
(
SIGCHAIN_SIGNAL_50
);
...
...
@@ -211,5 +220,6 @@ static void sigchain_rm_special_handler_010()
int
main
(
void
)
{
sigchain_rm_special_handler_010
();
EXPECT_EQ
(
"sigchain_rm_special_handler_010"
,
g_count
,
0
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_k.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_011"
,
true
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_011"
,
true
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler2(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler3
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_011"
,
true
);
return
false
;
}
...
...
@@ -52,6 +56,7 @@ static bool sigchain_special_handler3(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler4
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_011"
,
true
);
return
false
;
}
...
...
@@ -61,6 +66,7 @@ static bool sigchain_special_handler4(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler5
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_011"
,
true
);
return
false
;
}
...
...
@@ -70,6 +76,7 @@ static bool sigchain_special_handler5(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler6
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_011"
,
true
);
return
false
;
}
...
...
@@ -79,6 +86,7 @@ static bool sigchain_special_handler6(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler7
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_011"
,
true
);
return
false
;
}
...
...
@@ -88,6 +96,7 @@ static bool sigchain_special_handler7(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler8
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_011"
,
true
);
return
false
;
}
...
...
@@ -97,6 +106,7 @@ static bool sigchain_special_handler8(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler9
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_011"
,
true
);
return
false
;
}
...
...
@@ -106,6 +116,7 @@ static bool sigchain_special_handler9(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler10
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_011"
,
true
);
return
false
;
}
...
...
@@ -115,6 +126,7 @@ static bool sigchain_special_handler10(int signo, siginfo_t *siginfo, void *ucon
*/
static
void
signal_handler
(
int
signo
)
{
g_count
++
;
if
(
signo
==
SIGHUP
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_011"
,
signo
,
SIGHUP
);
}
else
if
(
signo
==
SIGABRT
)
{
...
...
@@ -252,5 +264,6 @@ int main(void)
raise
(
SIGCHAIN_SIGNAL_50
);
raise
(
SIGCHAIN_SIGNAL_56
);
raise
(
SIGCHAIN_SIGNAL_64
);
EXPECT_EQ
(
"sigchain_rm_special_handler_011"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_10
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_l.c
浏览文件 @
83f800ab
...
...
@@ -20,11 +20,13 @@
#include "functionalext.h"
#include "sigchain_util.h"
static
int
g_count
=
0
;
/**
* @brief the special handler
*/
static
bool
sigchain_special_handler1
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_012"
,
true
);
return
false
;
}
...
...
@@ -34,6 +36,7 @@ static bool sigchain_special_handler1(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler2
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_012"
,
true
);
return
false
;
}
...
...
@@ -43,6 +46,7 @@ static bool sigchain_special_handler2(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler3
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_012"
,
true
);
return
false
;
}
...
...
@@ -52,6 +56,7 @@ static bool sigchain_special_handler3(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler4
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_012"
,
true
);
return
false
;
}
...
...
@@ -61,6 +66,7 @@ static bool sigchain_special_handler4(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler5
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_012"
,
true
);
return
false
;
}
...
...
@@ -70,6 +76,7 @@ static bool sigchain_special_handler5(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler6
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_012"
,
true
);
return
false
;
}
...
...
@@ -79,6 +86,7 @@ static bool sigchain_special_handler6(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler7
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_012"
,
true
);
return
false
;
}
...
...
@@ -88,6 +96,7 @@ static bool sigchain_special_handler7(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler8
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_012"
,
true
);
return
false
;
}
...
...
@@ -97,6 +106,7 @@ static bool sigchain_special_handler8(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler9
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_012"
,
true
);
return
false
;
}
...
...
@@ -106,6 +116,7 @@ static bool sigchain_special_handler9(int signo, siginfo_t *siginfo, void *ucont
*/
static
bool
sigchain_special_handler10
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
g_count
++
;
EXPECT_FALSE
(
"sigchain_rm_special_handler_012"
,
true
);
return
false
;
}
...
...
@@ -115,6 +126,7 @@ static bool sigchain_special_handler10(int signo, siginfo_t *siginfo, void *ucon
*/
static
void
signal_sigaction
(
int
signo
)
{
g_count
++
;
if
(
signo
==
SIGHUP
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_012"
,
signo
,
SIGHUP
);
}
else
if
(
signo
==
SIGABRT
)
{
...
...
@@ -291,5 +303,6 @@ int main(void)
raise
(
SIGCHAIN_SIGNAL_50
);
raise
(
SIGCHAIN_SIGNAL_56
);
raise
(
SIGCHAIN_SIGNAL_64
);
EXPECT_EQ
(
"sigchain_rm_special_handler_012"
,
g_count
,
SIGCHIAN_TEST_SIGNAL_NUM_10
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/test_src_functionalext_sigchain.gni
浏览文件 @
83f800ab
...
...
@@ -48,5 +48,6 @@ functionalext_sigchain_list = [
"sigchain_intercept_sigprocmask_d",
"sigchain_intercept_sigprocmask_e",
"sigchain_intercept_sigprocmask_f",
"sigchain_intercept_sigprocmask_g",
"sigchain_call_special_handler_a",
]
porting/linux/user/src/signal/sigprocmask.c
浏览文件 @
83f800ab
#include <signal.h>
#include <errno.h>
#include <sigchain.h>
#include <stddef.h>
#include <hilog_adapter.h>
#include <string.h>
#include "sys_param.h"
extern
void
intercept_sigprocmask
(
int
how
,
sigset_t
*
restrict
set
);
static
const
char
*
param_name
=
"musl.sigchain.procmask"
;
bool
get_sigchain_mask_enable
()
{
static
CachedHandle
musl_log_Handle
=
NULL
;
if
(
musl_log_Handle
==
NULL
)
{
musl_log_Handle
=
CachedParameterCreate
(
param_name
,
"false"
);
}
char
*
param_value
=
CachedParameterGet
(
musl_log_Handle
);
if
(
param_value
!=
NULL
)
{
if
(
strcmp
(
param_value
,
"true"
)
==
0
)
{
return
true
;
}
}
return
false
;
}
int
sigprocmask
(
int
how
,
const
sigset_t
*
restrict
set
,
sigset_t
*
restrict
old
)
{
int
r
=
0
;
if
(
set
)
{
if
(
set
&&
get_sigchain_mask_enable
()
)
{
sigset_t
tmpset
=
*
set
;
intercept_sigprocmask
(
how
,
&
tmpset
);
const
sigset_t
*
new_set_ptr
=
&
tmpset
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录