Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
9c6fcc2c
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看板
提交
9c6fcc2c
编写于
2月 03, 2023
作者:
D
dhy308
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix codeCheck errors
Issue: I6AEEI Test: Build & Boot Devices Signed-off-by:
N
dhy308
<
tony.gan@huawei.com
>
上级
f8a2eb1e
变更
36
隐藏空白更改
内联
并排
Showing
36 changed file
with
264 addition
and
225 deletion
+264
-225
libc-test/src/functionalext/common/sigchain_util.h
libc-test/src/functionalext/common/sigchain_util.h
+12
-1
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_a.c
...c/functionalext/sigchain/sigchain_add_special_handler_a.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_b.c
...c/functionalext/sigchain/sigchain_add_special_handler_b.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_c.c
...c/functionalext/sigchain/sigchain_add_special_handler_c.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_d.c
...c/functionalext/sigchain/sigchain_add_special_handler_d.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_e.c
...c/functionalext/sigchain/sigchain_add_special_handler_e.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_f.c
...c/functionalext/sigchain/sigchain_add_special_handler_f.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_g.c
...c/functionalext/sigchain/sigchain_add_special_handler_g.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_h.c
...c/functionalext/sigchain/sigchain_add_special_handler_h.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_i.c
...c/functionalext/sigchain/sigchain_add_special_handler_i.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_j.c
...c/functionalext/sigchain/sigchain_add_special_handler_j.c
+23
-17
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_k.c
...c/functionalext/sigchain/sigchain_add_special_handler_k.c
+37
-31
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_l.c
...c/functionalext/sigchain/sigchain_add_special_handler_l.c
+36
-31
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_m.c
...c/functionalext/sigchain/sigchain_add_special_handler_m.c
+2
-1
libc-test/src/functionalext/sigchain/sigchain_intercept_sigaction_b.c
...c/functionalext/sigchain/sigchain_intercept_sigaction_b.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_intercept_sigaction_c.c
...c/functionalext/sigchain/sigchain_intercept_sigaction_c.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_intercept_signal_b.c
.../src/functionalext/sigchain/sigchain_intercept_signal_b.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_intercept_signal_c.c
.../src/functionalext/sigchain/sigchain_intercept_signal_c.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_a.c
...functionalext/sigchain/sigchain_intercept_sigprocmask_a.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_b.c
...functionalext/sigchain/sigchain_intercept_sigprocmask_b.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_c.c
...functionalext/sigchain/sigchain_intercept_sigprocmask_c.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_d.c
...functionalext/sigchain/sigchain_intercept_sigprocmask_d.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_b.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_b.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_c.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_c.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_d.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_d.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_e.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_e.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_f.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_f.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_g.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_g.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_h.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_h.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_i.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_i.c
+2
-2
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_j.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_j.c
+16
-15
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_k.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_k.c
+30
-29
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_l.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_l.c
+30
-29
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_m.c
...rc/functionalext/sigchain/sigchain_rm_special_handler_m.c
+3
-2
porting/linux/user/include/sigchain.h
porting/linux/user/include/sigchain.h
+7
-6
porting/linux/user/src/sigchain/sigchain.c
porting/linux/user/src/sigchain/sigchain.c
+18
-13
未找到文件。
libc-test/src/functionalext/common/sigchain_util.h
浏览文件 @
9c6fcc2c
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
#define SIGCH
IA
N_TEST_SET_MASK(set, fun, signo, num) do{ \
#define SIGCH
AI
N_TEST_SET_MASK(set, fun, signo, num) do{ \
int result = sigemptyset(&set); \
if (result != 0) { \
EXPECT_FALSE(fun, (result == 0)); \
...
...
@@ -29,3 +29,14 @@
EXPECT_FALSE(fun, (result == 0)); \
} \
} while (0)
#define SIGCHIAN_TEST_SIGNAL_NUM_1 1
#define SIGCHIAN_TEST_SIGNAL_NUM_2 2
#define SIGCHIAN_TEST_SIGNAL_NUM_10 10
#define SIGCHAIN_SIGNAL_37 37
#define SIGCHAIN_SIGNAL_43 43
#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
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_a.c
浏览文件 @
9c6fcc2c
...
...
@@ -45,8 +45,8 @@ static void sigchain_add_special_handler_001()
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv
);
sigset_t
set
=
{
0
};
int
signo
[
1
]
=
{
SIGSEGV
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_001"
,
signo
,
1
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
1
]
=
{
SIGSEGV
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_001"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
1
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_b.c
浏览文件 @
9c6fcc2c
...
...
@@ -56,8 +56,8 @@ static void sigchain_add_special_handler_002()
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv
);
sigset_t
set
=
{
0
};
int
signo
[
1
]
=
{
SIGSEGV
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_002"
,
signo
,
1
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
1
]
=
{
SIGSEGV
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
1
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_c.c
浏览文件 @
9c6fcc2c
...
...
@@ -58,8 +58,8 @@ static void sigchain_add_special_handler_003()
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv
);
sigset_t
set
=
{
0
};
int
signo
[
1
]
=
{
SIGSEGV
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_003"
,
signo
,
1
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
1
]
=
{
SIGSEGV
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_003"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
1
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_d.c
浏览文件 @
9c6fcc2c
...
...
@@ -77,8 +77,8 @@ static void sigchain_add_special_handler_004()
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv2
);
sigset_t
set
=
{
0
};
int
signo
[
1
]
=
{
SIGSEGV
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_004"
,
signo
,
1
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
1
]
=
{
SIGSEGV
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_004"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
1
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_e.c
浏览文件 @
9c6fcc2c
...
...
@@ -87,8 +87,8 @@ static void sigchain_add_special_handler_005()
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv2
);
sigset_t
set
=
{
0
};
int
signo
[
1
]
=
{
SIGSEGV
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_005"
,
signo
,
1
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
1
]
=
{
SIGSEGV
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_005"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
1
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_f.c
浏览文件 @
9c6fcc2c
...
...
@@ -90,8 +90,8 @@ static void sigchain_add_special_handler_006()
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv3
);
sigset_t
set
=
{
0
};
int
signo
[
1
]
=
{
SIGSEGV
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_006"
,
signo
,
1
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
1
]
=
{
SIGSEGV
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_006"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
1
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_g.c
浏览文件 @
9c6fcc2c
...
...
@@ -61,8 +61,8 @@ static void sigchain_add_special_handler_007()
add_special_signal_handler
(
SIGHUP
,
&
sigsegv1
);
sigset_t
set
=
{
0
};
int
signo
[
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_007"
,
signo
,
2
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_007"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
2
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_h.c
浏览文件 @
9c6fcc2c
...
...
@@ -75,8 +75,8 @@ static void sigchain_add_special_handler_008()
add_special_signal_handler
(
SIGHUP
,
&
sigsegv1
);
sigset_t
set
=
{
0
};
int
signo
[
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_008"
,
signo
,
2
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_008"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
2
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_i.c
浏览文件 @
9c6fcc2c
...
...
@@ -78,8 +78,8 @@ static void sigchain_add_special_handler_009()
add_special_signal_handler
(
SIGHUP
,
&
sigsegv2
);
sigset_t
set
=
{
0
};
int
signo
[
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_009"
,
signo
,
2
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_009"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
2
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_j.c
浏览文件 @
9c6fcc2c
...
...
@@ -70,7 +70,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
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
37
);
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
SIGCHAIN_SIGNAL_
37
);
return
false
;
}
...
...
@@ -79,7 +79,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
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
43
);
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
SIGCHAIN_SIGNAL_
43
);
return
false
;
}
...
...
@@ -88,7 +88,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
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
50
);
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
SIGCHAIN_SIGNAL_
50
);
return
false
;
}
...
...
@@ -97,7 +97,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
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
56
);
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
SIGCHAIN_SIGNAL_
56
);
return
false
;
}
...
...
@@ -106,7 +106,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
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
64
);
EXPECT_EQ
(
"sigchain_add_special_handler_010"
,
signo
,
SIGCHAIN_SIGNAL_
64
);
return
false
;
}
...
...
@@ -158,39 +158,45 @@ static void sigchain_add_special_handler_010()
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
37
,
&
sigsegv5
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
37
,
&
sigsegv5
);
struct
signal_chain_action
sigsegv6
=
{
.
sca_sigaction
=
sigchain_special_handler7
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
43
,
&
sigsegv6
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
43
,
&
sigsegv6
);
struct
signal_chain_action
sigsegv7
=
{
.
sca_sigaction
=
sigchain_special_handler8
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
50
,
&
sigsegv7
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
50
,
&
sigsegv7
);
struct
signal_chain_action
sigsegv8
=
{
.
sca_sigaction
=
sigchain_special_handler9
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
56
,
&
sigsegv8
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
56
,
&
sigsegv8
);
struct
signal_chain_action
sigsegv9
=
{
.
sca_sigaction
=
sigchain_special_handler10
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
64
,
&
sigsegv9
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
64
,
&
sigsegv9
);
sigset_t
set
=
{
0
};
int
signo
[
10
]
=
{
SIGHUP
,
SIGABRT
,
SIGSEGV
,
SIGURG
,
SIGSYS
,
37
,
43
,
50
,
56
,
64
};
SIGCHIAN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_010"
,
signo
,
10
);
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
)
...
...
@@ -201,10 +207,10 @@ int main(void)
raise
(
SIGSEGV
);
raise
(
SIGURG
);
raise
(
SIGSYS
);
raise
(
37
);
raise
(
43
);
raise
(
50
);
raise
(
56
);
raise
(
64
);
raise
(
SIGCHAIN_SIGNAL_
37
);
raise
(
SIGCHAIN_SIGNAL_
43
);
raise
(
SIGCHAIN_SIGNAL_
50
);
raise
(
SIGCHAIN_SIGNAL_
56
);
raise
(
SIGCHAIN_SIGNAL_
64
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_k.c
浏览文件 @
9c6fcc2c
...
...
@@ -70,7 +70,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
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
37
);
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_
37
);
return
false
;
}
...
...
@@ -79,7 +79,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
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
43
);
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_
43
);
return
false
;
}
...
...
@@ -88,7 +88,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
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
50
);
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_
50
);
return
false
;
}
...
...
@@ -97,7 +97,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
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
56
);
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_
56
);
return
false
;
}
...
...
@@ -106,7 +106,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
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
64
);
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_
64
);
return
false
;
}
...
...
@@ -125,16 +125,16 @@ static void signal_handler(int signo)
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGURG
);
}
else
if
(
signo
==
SIGSYS
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGSYS
);
}
else
if
(
signo
==
37
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
37
);
}
else
if
(
signo
==
43
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
43
);
}
else
if
(
signo
==
50
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
50
);
}
else
if
(
signo
==
56
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
56
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
37
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_
37
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
43
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_
43
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
50
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_
50
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
56
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_
56
);
}
else
{
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
64
);
EXPECT_EQ
(
"sigchain_add_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_
64
);
}
}
...
...
@@ -151,11 +151,11 @@ static void sigchain_add_special_handler_011()
signal
(
SIGSEGV
,
signal_handler
);
signal
(
SIGURG
,
signal_handler
);
signal
(
SIGSYS
,
signal_handler
);
signal
(
37
,
signal_handler
);
signal
(
43
,
signal_handler
);
signal
(
50
,
signal_handler
);
signal
(
56
,
signal_handler
);
signal
(
64
,
signal_handler
);
signal
(
SIGCHAIN_SIGNAL_
37
,
signal_handler
);
signal
(
SIGCHAIN_SIGNAL_
43
,
signal_handler
);
signal
(
SIGCHAIN_SIGNAL_
50
,
signal_handler
);
signal
(
SIGCHAIN_SIGNAL_
56
,
signal_handler
);
signal
(
SIGCHAIN_SIGNAL_
64
,
signal_handler
);
struct
signal_chain_action
sigsegv
=
{
.
sca_sigaction
=
sigchain_special_handler1
,
...
...
@@ -197,39 +197,45 @@ static void sigchain_add_special_handler_011()
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
37
,
&
sigsegv5
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
37
,
&
sigsegv5
);
struct
signal_chain_action
sigsegv6
=
{
.
sca_sigaction
=
sigchain_special_handler7
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
43
,
&
sigsegv6
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
43
,
&
sigsegv6
);
struct
signal_chain_action
sigsegv7
=
{
.
sca_sigaction
=
sigchain_special_handler8
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
50
,
&
sigsegv7
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
50
,
&
sigsegv7
);
struct
signal_chain_action
sigsegv8
=
{
.
sca_sigaction
=
sigchain_special_handler9
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
56
,
&
sigsegv8
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
56
,
&
sigsegv8
);
struct
signal_chain_action
sigsegv9
=
{
.
sca_sigaction
=
sigchain_special_handler10
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
64
,
&
sigsegv9
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
64
,
&
sigsegv9
);
sigset_t
set
=
{
0
};
int
signo
[
10
]
=
{
SIGHUP
,
SIGABRT
,
SIGSEGV
,
SIGURG
,
SIGSYS
,
37
,
43
,
50
,
56
,
64
};
SIGCHIAN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_011"
,
signo
,
10
);
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
)
...
...
@@ -240,10 +246,10 @@ int main(void)
raise
(
SIGSEGV
);
raise
(
SIGURG
);
raise
(
SIGSYS
);
raise
(
37
);
raise
(
43
);
raise
(
50
);
raise
(
56
);
raise
(
64
);
raise
(
SIGCHAIN_SIGNAL_
37
);
raise
(
SIGCHAIN_SIGNAL_
43
);
raise
(
SIGCHAIN_SIGNAL_
50
);
raise
(
SIGCHAIN_SIGNAL_
56
);
raise
(
SIGCHAIN_SIGNAL_
64
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_l.c
浏览文件 @
9c6fcc2c
...
...
@@ -71,7 +71,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
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
37
);
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_
37
);
return
false
;
}
...
...
@@ -80,7 +80,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
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
43
);
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_
43
);
return
false
;
}
...
...
@@ -89,7 +89,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
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
50
);
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_
50
);
return
false
;
}
...
...
@@ -98,7 +98,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
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
56
);
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_
56
);
return
false
;
}
...
...
@@ -107,7 +107,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
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
64
);
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_
64
);
return
false
;
}
...
...
@@ -126,16 +126,16 @@ static void signal_sigaction(int signo)
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGURG
);
}
else
if
(
signo
==
SIGSYS
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGSYS
);
}
else
if
(
signo
==
37
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
37
);
}
else
if
(
signo
==
43
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
43
);
}
else
if
(
signo
==
50
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
50
);
}
else
if
(
signo
==
56
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
56
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
37
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_
37
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
43
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_
43
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
50
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_
50
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
56
)
{
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_
56
);
}
else
{
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
64
);
EXPECT_EQ
(
"sigchain_add_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_
64
);
}
}
...
...
@@ -175,27 +175,27 @@ static void sigchain_add_special_handler_012()
struct
sigaction
sigaction5
=
{
.
sa_handler
=
signal_sigaction
,
};
sigaction
(
37
,
&
sigaction5
,
NULL
);
sigaction
(
SIGCHAIN_SIGNAL_
37
,
&
sigaction5
,
NULL
);
struct
sigaction
sigaction6
=
{
.
sa_handler
=
signal_sigaction
,
};
sigaction
(
43
,
&
sigaction6
,
NULL
);
sigaction
(
SIGCHAIN_SIGNAL_
43
,
&
sigaction6
,
NULL
);
struct
sigaction
sigaction7
=
{
.
sa_handler
=
signal_sigaction
,
};
sigaction
(
50
,
&
sigaction7
,
NULL
);
sigaction
(
SIGCHAIN_SIGNAL_
50
,
&
sigaction7
,
NULL
);
struct
sigaction
sigaction8
=
{
.
sa_handler
=
signal_sigaction
,
};
sigaction
(
56
,
&
sigaction8
,
NULL
);
sigaction
(
SIGCHAIN_SIGNAL_
56
,
&
sigaction8
,
NULL
);
struct
sigaction
sigaction9
=
{
.
sa_handler
=
signal_sigaction
,
};
sigaction
(
64
,
&
sigaction9
,
NULL
);
sigaction
(
SIGCHAIN_SIGNAL_
64
,
&
sigaction9
,
NULL
);
struct
signal_chain_action
sigsegv
=
{
.
sca_sigaction
=
sigchain_special_handler1
,
...
...
@@ -237,39 +237,44 @@ static void sigchain_add_special_handler_012()
.
sca_mask
=
{},
.
sca_flags
=
SIGCHAIN_ALLOW_NORETURN
,
};
add_special_signal_handler
(
37
,
&
sigsegv5
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
37
,
&
sigsegv5
);
struct
signal_chain_action
sigsegv6
=
{
.
sca_sigaction
=
sigchain_special_handler7
,
.
sca_mask
=
{},
.
sca_flags
=
SIGCHAIN_ALLOW_NORETURN
,
};
add_special_signal_handler
(
43
,
&
sigsegv6
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
43
,
&
sigsegv6
);
struct
signal_chain_action
sigsegv7
=
{
.
sca_sigaction
=
sigchain_special_handler8
,
.
sca_mask
=
{},
.
sca_flags
=
SIGCHAIN_ALLOW_NORETURN
,
};
add_special_signal_handler
(
50
,
&
sigsegv7
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
50
,
&
sigsegv7
);
struct
signal_chain_action
sigsegv8
=
{
.
sca_sigaction
=
sigchain_special_handler9
,
.
sca_mask
=
{},
.
sca_flags
=
SIGCHAIN_ALLOW_NORETURN
,
};
add_special_signal_handler
(
56
,
&
sigsegv8
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
56
,
&
sigsegv8
);
struct
signal_chain_action
sigsegv9
=
{
.
sca_sigaction
=
sigchain_special_handler10
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
64
,
&
sigsegv9
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
64
,
&
sigsegv9
);
sigset_t
set
=
{
0
};
int
signo
[
10
]
=
{
SIGHUP
,
SIGABRT
,
SIGSEGV
,
SIGURG
,
SIGSYS
,
37
,
43
,
50
,
56
,
64
};
SIGCHIAN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_012"
,
signo
,
10
);
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
)
...
...
@@ -280,10 +285,10 @@ int main(void)
raise
(
SIGSEGV
);
raise
(
SIGURG
);
raise
(
SIGSYS
);
raise
(
37
);
raise
(
43
);
raise
(
50
);
raise
(
56
);
raise
(
64
);
raise
(
SIGCHAIN_SIGNAL_
37
);
raise
(
SIGCHAIN_SIGNAL_
43
);
raise
(
SIGCHAIN_SIGNAL_
50
);
raise
(
SIGCHAIN_SIGNAL_
56
);
raise
(
SIGCHAIN_SIGNAL_
64
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_add_special_handler_m.c
浏览文件 @
9c6fcc2c
...
...
@@ -18,6 +18,7 @@
#include <stdlib.h>
#include "test.h"
#include "functionalext.h"
#include "sigchain_util.h"
/**
* @brief the special handler
...
...
@@ -56,7 +57,7 @@ static void sigchain_add_special_handler_013()
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
65
,
&
sigsegv1
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
65
,
&
sigsegv1
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_intercept_sigaction_b.c
浏览文件 @
9c6fcc2c
...
...
@@ -87,8 +87,8 @@ static void sigchain_intercept_sigaction_002()
sigaction
(
SIGSEGV
,
&
siga2
,
NULL
);
sigset_t
set
=
{
0
};
int
signo
[
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigaction_002"
,
signo
,
2
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigaction_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
2
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_intercept_sigaction_c.c
浏览文件 @
9c6fcc2c
...
...
@@ -87,8 +87,8 @@ static void sigchain_intercept_sigaction_003()
sigaction
(
SIGSEGV
,
&
siga2
,
NULL
);
sigset_t
set
=
{
0
};
int
signo
[
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigaction_002"
,
signo
,
2
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
AIN_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
);
...
...
libc-test/src/functionalext/sigchain/sigchain_intercept_signal_b.c
浏览文件 @
9c6fcc2c
...
...
@@ -80,8 +80,8 @@ static void sigchain_intercept_signal_002()
signal
(
SIGSEGV
,
signal_handler2
);
sigset_t
set
=
{
0
};
int
signo
[
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_intercept_signal_002"
,
signo
,
2
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_signal_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
2
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_intercept_signal_c.c
浏览文件 @
9c6fcc2c
...
...
@@ -83,8 +83,8 @@ static void sigchain_intercept_signal_003()
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler1
);
sigset_t
set
=
{
0
};
int
signo
[
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigaction_002"
,
signo
,
2
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigaction_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
2
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_a.c
浏览文件 @
9c6fcc2c
...
...
@@ -55,8 +55,8 @@ static void sigchain_intercept_sigprocmask_001()
sigaction
(
SIGSEGV
,
&
siga2
,
NULL
);
sigset_t
set
=
{
0
};
int
signo
[
2
]
=
{
SIGHUP
,
SIGSEGV
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigprocmask_001"
,
signo
,
2
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
2
]
=
{
SIGHUP
,
SIGSEGV
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigprocmask_001"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
2
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_b.c
浏览文件 @
9c6fcc2c
...
...
@@ -87,8 +87,8 @@ static void sigchain_intercept_sigprocmask_002()
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv1
);
sigset_t
set
=
{
0
};
int
signo
[
2
]
=
{
SIGHUP
,
SIGSEGV
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigprocmask_002"
,
signo
,
2
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
2
]
=
{
SIGHUP
,
SIGSEGV
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigprocmask_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
2
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_c.c
浏览文件 @
9c6fcc2c
...
...
@@ -87,8 +87,8 @@ static void sigchain_intercept_sigprocmask_003()
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv1
);
sigset_t
set
=
{
0
};
int
signo
[
2
]
=
{
SIGHUP
,
SIGSEGV
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigprocmask_003"
,
signo
,
2
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
2
]
=
{
SIGHUP
,
SIGSEGV
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigprocmask_003"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
2
);
remove_special_signal_handler
(
SIGHUP
,
sigchain_special_handler
);
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler1
);
...
...
libc-test/src/functionalext/sigchain/sigchain_intercept_sigprocmask_d.c
浏览文件 @
9c6fcc2c
...
...
@@ -88,8 +88,8 @@ static void sigchain_intercept_sigprocmask_004()
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv1
);
sigset_t
set
=
{
0
};
int
signo
[
2
]
=
{
SIGHUP
,
SIGSEGV
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigprocmask_004"
,
signo
,
2
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
2
]
=
{
SIGHUP
,
SIGSEGV
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_intercept_sigprocmask_004"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
2
);
}
void
thread_func
(
void
*
data
)
...
...
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_b.c
浏览文件 @
9c6fcc2c
...
...
@@ -55,8 +55,8 @@ static void sigchain_rm_special_handler_002()
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv
);
sigset_t
set
=
{
0
};
int
signo
[
1
]
=
{
SIGSEGV
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_002"
,
signo
,
1
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
1
]
=
{
SIGSEGV
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_add_special_handler_002"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
1
);
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler
);
}
...
...
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_c.c
浏览文件 @
9c6fcc2c
...
...
@@ -58,8 +58,8 @@ static void sigchain_rm_special_handler_003()
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv
);
sigset_t
set
=
{
0
};
int
signo
[
1
]
=
{
SIGSEGV
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_003"
,
signo
,
1
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
1
]
=
{
SIGSEGV
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_003"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
1
);
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler
);
}
...
...
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_d.c
浏览文件 @
9c6fcc2c
...
...
@@ -77,8 +77,8 @@ static void sigchain_rm_special_handler_004()
add_special_signal_handler
(
SIGHUP
,
&
sigsegv2
);
sigset_t
set
=
{
0
};
int
signo
[
1
]
=
{
SIGHUP
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_004"
,
signo
,
1
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
1
]
=
{
SIGHUP
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_004"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
1
);
remove_special_signal_handler
(
SIGHUP
,
sigchain_special_handler3
);
remove_special_signal_handler
(
SIGHUP
,
sigchain_special_handler2
);
...
...
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_e.c
浏览文件 @
9c6fcc2c
...
...
@@ -87,8 +87,8 @@ static void sigchain_rm_special_handler_005()
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv2
);
sigset_t
set
=
{
0
};
int
signo
[
1
]
=
{
SIGSEGV
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_005"
,
signo
,
1
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
1
]
=
{
SIGSEGV
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_005"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
1
);
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler3
);
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler2
);
...
...
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_f.c
浏览文件 @
9c6fcc2c
...
...
@@ -90,8 +90,8 @@ static void sigchain_rm_special_handler_006()
add_special_signal_handler
(
SIGSEGV
,
&
sigsegv3
);
sigset_t
set
=
{
0
};
int
signo
[
1
]
=
{
SIGSEGV
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_006"
,
signo
,
1
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
1
]
=
{
SIGSEGV
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_006"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
1
);
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler3
);
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler2
);
...
...
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_g.c
浏览文件 @
9c6fcc2c
...
...
@@ -61,8 +61,8 @@ static void sigchain_rm_special_handler_007()
add_special_signal_handler
(
SIGHUP
,
&
sigsegv1
);
sigset_t
set
=
{
0
};
int
signo
[
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_007"
,
signo
,
2
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
AIN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_007"
,
signo
,
SIGCHIAN_TEST_SIGNAL_NUM_
2
);
remove_special_signal_handler
(
SIGHUP
,
sigchain_special_handler1
);
remove_special_signal_handler
(
64
,
sigchain_special_handler2
);
...
...
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_h.c
浏览文件 @
9c6fcc2c
...
...
@@ -76,8 +76,8 @@ static void sigchain_rm_special_handler_008()
add_special_signal_handler
(
SIGHUP
,
&
sigsegv1
);
sigset_t
set
=
{
0
};
int
signo
[
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_008"
,
signo
,
2
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
AIN_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
);
...
...
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_i.c
浏览文件 @
9c6fcc2c
...
...
@@ -83,8 +83,8 @@ static void sigchain_rm_special_handler_009()
add_special_signal_handler
(
SIGHUP
,
&
sighup
);
sigset_t
set
=
{
0
};
int
signo
[
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
IAN_TEST_SET_MASK
(
set
,
"sigchain_rm_special_handler_009"
,
signo
,
2
);
int
signo
[
SIGCHIAN_TEST_SIGNAL_NUM_
2
]
=
{
SIGSEGV
,
SIGHUP
};
SIGCH
AIN_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
);
...
...
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_j.c
浏览文件 @
9c6fcc2c
...
...
@@ -18,6 +18,7 @@
#include <stdlib.h>
#include "test.h"
#include "functionalext.h"
#include "sigchain_util.h"
/**
* @brief the special handler
...
...
@@ -157,54 +158,54 @@ static void sigchain_rm_special_handler_010()
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
37
,
&
sigsegv5
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
37
,
&
sigsegv5
);
struct
signal_chain_action
sigsegv6
=
{
.
sca_sigaction
=
sigchain_special_handler7
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
43
,
&
sigsegv6
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
43
,
&
sigsegv6
);
struct
signal_chain_action
sigsegv7
=
{
.
sca_sigaction
=
sigchain_special_handler8
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
50
,
&
sigsegv7
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
50
,
&
sigsegv7
);
struct
signal_chain_action
sigsegv8
=
{
.
sca_sigaction
=
sigchain_special_handler9
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
56
,
&
sigsegv8
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
56
,
&
sigsegv8
);
struct
signal_chain_action
sigsegv9
=
{
.
sca_sigaction
=
sigchain_special_handler10
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
64
,
&
sigsegv9
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
64
,
&
sigsegv9
);
remove_special_signal_handler
(
SIGHUP
,
sigchain_special_handler1
);
remove_special_signal_handler
(
SIGABRT
,
sigchain_special_handler2
);
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler3
);
remove_special_signal_handler
(
SIGURG
,
sigchain_special_handler4
);
remove_special_signal_handler
(
SIGSYS
,
sigchain_special_handler5
);
remove_special_signal_handler
(
37
,
sigchain_special_handler6
);
remove_special_signal_handler
(
43
,
sigchain_special_handler7
);
remove_special_signal_handler
(
50
,
sigchain_special_handler8
);
remove_special_signal_handler
(
56
,
sigchain_special_handler9
);
remove_special_signal_handler
(
64
,
sigchain_special_handler10
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_
37
,
sigchain_special_handler6
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_
43
,
sigchain_special_handler7
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_
50
,
sigchain_special_handler8
);
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
(
37
);
raise
(
43
);
raise
(
50
);
raise
(
56
);
raise
(
64
);
raise
(
SIGCHAIN_SIGNAL_
37
);
raise
(
SIGCHAIN_SIGNAL_
43
);
raise
(
SIGCHAIN_SIGNAL_
50
);
raise
(
SIGCHAIN_SIGNAL_
56
);
raise
(
SIGCHAIN_SIGNAL_
64
);
}
int
main
(
void
)
...
...
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_k.c
浏览文件 @
9c6fcc2c
...
...
@@ -18,6 +18,7 @@
#include <stdlib.h>
#include "test.h"
#include "functionalext.h"
#include "sigchain_util.h"
/**
* @brief the special handler
...
...
@@ -124,16 +125,16 @@ static void signal_handler(int signo)
EXPECT_EQ
(
"sigchain_rm_special_handler_011"
,
signo
,
SIGURG
);
}
else
if
(
signo
==
SIGSYS
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_011"
,
signo
,
SIGSYS
);
}
else
if
(
signo
==
37
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_011"
,
signo
,
37
);
}
else
if
(
signo
==
43
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_011"
,
signo
,
43
);
}
else
if
(
signo
==
50
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_011"
,
signo
,
50
);
}
else
if
(
signo
==
56
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_011"
,
signo
,
56
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
37
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_
37
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
43
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_
43
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
50
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_
50
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
56
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_
56
);
}
else
{
EXPECT_EQ
(
"sigchain_rm_special_handler_011"
,
signo
,
64
);
EXPECT_EQ
(
"sigchain_rm_special_handler_011"
,
signo
,
SIGCHAIN_SIGNAL_
64
);
}
}
...
...
@@ -150,11 +151,11 @@ static void sigchain_rm_special_handler_011()
signal
(
SIGSEGV
,
signal_handler
);
signal
(
SIGURG
,
signal_handler
);
signal
(
SIGSYS
,
signal_handler
);
signal
(
37
,
signal_handler
);
signal
(
43
,
signal_handler
);
signal
(
50
,
signal_handler
);
signal
(
56
,
signal_handler
);
signal
(
64
,
signal_handler
);
signal
(
SIGCHAIN_SIGNAL_
37
,
signal_handler
);
signal
(
SIGCHAIN_SIGNAL_
43
,
signal_handler
);
signal
(
SIGCHAIN_SIGNAL_
50
,
signal_handler
);
signal
(
SIGCHAIN_SIGNAL_
56
,
signal_handler
);
signal
(
SIGCHAIN_SIGNAL_
64
,
signal_handler
);
struct
signal_chain_action
sigsegv
=
{
.
sca_sigaction
=
sigchain_special_handler1
,
...
...
@@ -196,46 +197,46 @@ static void sigchain_rm_special_handler_011()
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
37
,
&
sigsegv5
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
37
,
&
sigsegv5
);
struct
signal_chain_action
sigsegv6
=
{
.
sca_sigaction
=
sigchain_special_handler7
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
43
,
&
sigsegv6
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
43
,
&
sigsegv6
);
struct
signal_chain_action
sigsegv7
=
{
.
sca_sigaction
=
sigchain_special_handler8
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
50
,
&
sigsegv7
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
50
,
&
sigsegv7
);
struct
signal_chain_action
sigsegv8
=
{
.
sca_sigaction
=
sigchain_special_handler9
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
56
,
&
sigsegv8
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
56
,
&
sigsegv8
);
struct
signal_chain_action
sigsegv9
=
{
.
sca_sigaction
=
sigchain_special_handler10
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
64
,
&
sigsegv9
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
64
,
&
sigsegv9
);
remove_special_signal_handler
(
SIGHUP
,
sigchain_special_handler1
);
remove_special_signal_handler
(
SIGABRT
,
sigchain_special_handler2
);
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler3
);
remove_special_signal_handler
(
SIGURG
,
sigchain_special_handler4
);
remove_special_signal_handler
(
SIGSYS
,
sigchain_special_handler5
);
remove_special_signal_handler
(
37
,
sigchain_special_handler6
);
remove_special_signal_handler
(
43
,
sigchain_special_handler7
);
remove_special_signal_handler
(
50
,
sigchain_special_handler8
);
remove_special_signal_handler
(
56
,
sigchain_special_handler9
);
remove_special_signal_handler
(
64
,
sigchain_special_handler10
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_
37
,
sigchain_special_handler6
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_
43
,
sigchain_special_handler7
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_
50
,
sigchain_special_handler8
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_
56
,
sigchain_special_handler9
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_
64
,
sigchain_special_handler10
);
}
int
main
(
void
)
...
...
@@ -246,10 +247,10 @@ int main(void)
raise
(
SIGSEGV
);
raise
(
SIGURG
);
raise
(
SIGSYS
);
raise
(
37
);
raise
(
43
);
raise
(
50
);
raise
(
56
);
raise
(
64
);
raise
(
SIGCHAIN_SIGNAL_
37
);
raise
(
SIGCHAIN_SIGNAL_
43
);
raise
(
SIGCHAIN_SIGNAL_
50
);
raise
(
SIGCHAIN_SIGNAL_
56
);
raise
(
SIGCHAIN_SIGNAL_
64
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_l.c
浏览文件 @
9c6fcc2c
...
...
@@ -18,6 +18,7 @@
#include <stdlib.h>
#include "test.h"
#include "functionalext.h"
#include "sigchain_util.h"
/**
* @brief the special handler
...
...
@@ -124,16 +125,16 @@ static void signal_sigaction(int signo)
EXPECT_EQ
(
"sigchain_rm_special_handler_012"
,
signo
,
SIGURG
);
}
else
if
(
signo
==
SIGSYS
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_012"
,
signo
,
SIGSYS
);
}
else
if
(
signo
==
37
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_012"
,
signo
,
37
);
}
else
if
(
signo
==
43
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_012"
,
signo
,
43
);
}
else
if
(
signo
==
50
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_012"
,
signo
,
50
);
}
else
if
(
signo
==
56
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_012"
,
signo
,
56
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
37
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_
37
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
43
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_
43
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
50
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_
50
);
}
else
if
(
signo
==
SIGCHAIN_SIGNAL_
56
)
{
EXPECT_EQ
(
"sigchain_rm_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_
56
);
}
else
{
EXPECT_EQ
(
"sigchain_rm_special_handler_012"
,
signo
,
64
);
EXPECT_EQ
(
"sigchain_rm_special_handler_012"
,
signo
,
SIGCHAIN_SIGNAL_
64
);
}
}
...
...
@@ -173,27 +174,27 @@ static void sigchain_rm_special_handler_012()
struct
sigaction
sigaction5
=
{
.
sa_handler
=
signal_sigaction
,
};
sigaction
(
37
,
&
sigaction5
,
NULL
);
sigaction
(
SIGCHAIN_SIGNAL_
37
,
&
sigaction5
,
NULL
);
struct
sigaction
sigaction6
=
{
.
sa_handler
=
signal_sigaction
,
};
sigaction
(
43
,
&
sigaction6
,
NULL
);
sigaction
(
SIGCHAIN_SIGNAL_
43
,
&
sigaction6
,
NULL
);
struct
sigaction
sigaction7
=
{
.
sa_handler
=
signal_sigaction
,
};
sigaction
(
50
,
&
sigaction7
,
NULL
);
sigaction
(
SIGCHAIN_SIGNAL_
50
,
&
sigaction7
,
NULL
);
struct
sigaction
sigaction8
=
{
.
sa_handler
=
signal_sigaction
,
};
sigaction
(
56
,
&
sigaction8
,
NULL
);
sigaction
(
SIGCHAIN_SIGNAL_
56
,
&
sigaction8
,
NULL
);
struct
sigaction
sigaction9
=
{
.
sa_handler
=
signal_sigaction
,
};
sigaction
(
64
,
&
sigaction9
,
NULL
);
sigaction
(
SIGCHAIN_SIGNAL_
64
,
&
sigaction9
,
NULL
);
struct
signal_chain_action
sigsegv
=
{
.
sca_sigaction
=
sigchain_special_handler1
,
...
...
@@ -235,46 +236,46 @@ static void sigchain_rm_special_handler_012()
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
37
,
&
sigsegv5
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
37
,
&
sigsegv5
);
struct
signal_chain_action
sigsegv6
=
{
.
sca_sigaction
=
sigchain_special_handler7
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
43
,
&
sigsegv6
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
43
,
&
sigsegv6
);
struct
signal_chain_action
sigsegv7
=
{
.
sca_sigaction
=
sigchain_special_handler8
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
50
,
&
sigsegv7
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
50
,
&
sigsegv7
);
struct
signal_chain_action
sigsegv8
=
{
.
sca_sigaction
=
sigchain_special_handler9
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
56
,
&
sigsegv8
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
56
,
&
sigsegv8
);
struct
signal_chain_action
sigsegv9
=
{
.
sca_sigaction
=
sigchain_special_handler10
,
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
64
,
&
sigsegv9
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
64
,
&
sigsegv9
);
remove_special_signal_handler
(
SIGHUP
,
sigchain_special_handler1
);
remove_special_signal_handler
(
SIGABRT
,
sigchain_special_handler2
);
remove_special_signal_handler
(
SIGSEGV
,
sigchain_special_handler3
);
remove_special_signal_handler
(
SIGURG
,
sigchain_special_handler4
);
remove_special_signal_handler
(
SIGSYS
,
sigchain_special_handler5
);
remove_special_signal_handler
(
37
,
sigchain_special_handler6
);
remove_special_signal_handler
(
43
,
sigchain_special_handler7
);
remove_special_signal_handler
(
50
,
sigchain_special_handler8
);
remove_special_signal_handler
(
56
,
sigchain_special_handler9
);
remove_special_signal_handler
(
64
,
sigchain_special_handler10
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_
37
,
sigchain_special_handler6
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_
43
,
sigchain_special_handler7
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_
50
,
sigchain_special_handler8
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_
56
,
sigchain_special_handler9
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_
64
,
sigchain_special_handler10
);
}
int
main
(
void
)
...
...
@@ -285,10 +286,10 @@ int main(void)
raise
(
SIGSEGV
);
raise
(
SIGURG
);
raise
(
SIGSYS
);
raise
(
37
);
raise
(
43
);
raise
(
50
);
raise
(
56
);
raise
(
64
);
raise
(
SIGCHAIN_SIGNAL_
37
);
raise
(
SIGCHAIN_SIGNAL_
43
);
raise
(
SIGCHAIN_SIGNAL_
50
);
raise
(
SIGCHAIN_SIGNAL_
56
);
raise
(
SIGCHAIN_SIGNAL_
64
);
return
t_status
;
}
\ No newline at end of file
libc-test/src/functionalext/sigchain/sigchain_rm_special_handler_m.c
浏览文件 @
9c6fcc2c
...
...
@@ -18,6 +18,7 @@
#include <stdlib.h>
#include "test.h"
#include "functionalext.h"
#include "sigchain_util.h"
/**
* @brief the special handler
...
...
@@ -56,10 +57,10 @@ static void sigchain_rm_special_handler_013()
.
sca_mask
=
{},
.
sca_flags
=
0
,
};
add_special_signal_handler
(
65
,
&
sigsegv1
);
add_special_signal_handler
(
SIGCHAIN_SIGNAL_
65
,
&
sigsegv1
);
remove_special_signal_handler
(
0
,
sigchain_special_handler
);
remove_special_signal_handler
(
65
,
sigchain_special_handler1
);
remove_special_signal_handler
(
SIGCHAIN_SIGNAL_
65
,
sigchain_special_handler1
);
}
int
main
(
void
)
...
...
porting/linux/user/include/sigchain.h
浏览文件 @
9c6fcc2c
...
...
@@ -16,9 +16,6 @@
#ifndef _SIGCHAIN_H
#define _SIGCHAIN_H
#ifdef __cplusplus
extern
"C"
{
#endif
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
...
...
@@ -26,13 +23,17 @@ extern "C" {
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern
"C"
{
#endif
static
const
int
SIGCHAIN_ALLOW_NORETURN
=
0x1UL
;
/* The action of the sigchain. */
struct
signal_chain_action
{
bool
(
*
sca_sigaction
)(
int
,
siginfo_t
*
,
void
*
);
sigset_t
sca_mask
;
int
sca_flags
;
bool
(
*
sca_sigaction
)(
int
,
siginfo_t
*
,
void
*
);
sigset_t
sca_mask
;
int
sca_flags
;
};
/* Mark the signal to the sigchain, add the special handler to the sigchain. */
...
...
porting/linux/user/src/sigchain/sigchain.c
浏览文件 @
9c6fcc2c
...
...
@@ -30,9 +30,12 @@ extern int __libc_sigaction(int sig, const struct sigaction *restrict sa,
#define SIGCHAIN_LOG_TAG "SIGCHAIN"
#if (defined(OHOS_ENABLE_PARAMETER) || defined(ENABLE_MUSL_LOG))
#define SIGCHAIN_PRINT_ERROR(...) ((void)HiLogAdapterPrint(LOG_CORE, LOG_ERROR, SIGCHAIN_LOG_DOMAIN, SIGCHAIN_LOG_TAG, __VA_ARGS__))
#define SIGCHAIN_PRINT_INFO(...) ((void)HiLogAdapterPrint(LOG_CORE, LOG_INFO, SIGCHAIN_LOG_DOMAIN, SIGCHAIN_LOG_TAG, __VA_ARGS__))
#define SIGCHAIN_PRINT_DEBUG(...) ((void)HiLogAdapterPrint(LOG_CORE, LOG_DEBUG, SIGCHAIN_LOG_DOMAIN, SIGCHAIN_LOG_TAG, __VA_ARGS__))
#define SIGCHAIN_PRINT_ERROR(...) ((void)HiLogAdapterPrint(LOG_CORE, LOG_ERROR, \
SIGCHAIN_LOG_DOMAIN, SIGCHAIN_LOG_TAG, __VA_ARGS__))
#define SIGCHAIN_PRINT_INFO(...) ((void)HiLogAdapterPrint(LOG_CORE, LOG_INFO, \
SIGCHAIN_LOG_DOMAIN, SIGCHAIN_LOG_TAG, __VA_ARGS__))
#define SIGCHAIN_PRINT_DEBUG(...) ((void)HiLogAdapterPrint(LOG_CORE, LOG_DEBUG, \
SIGCHAIN_LOG_DOMAIN, SIGCHAIN_LOG_TAG, __VA_ARGS__))
#else
#define SIGCHAIN_PRINT_ERROR(...)
#define SIGCHAIN_PRINT_INFO(...)
...
...
@@ -71,7 +74,8 @@ void create_pthread_key(void)
* @brief Get the key of the signal thread.
* @retval int32_t, the value of the sigchain key.
*/
static
pthread_key_t
get_handling_signal_key
()
{
static
pthread_key_t
get_handling_signal_key
()
{
call_once
(
&
g_flag
,
create_pthread_key
);
return
g_sigchain_key
;
}
...
...
@@ -80,7 +84,8 @@ static pthread_key_t get_handling_signal_key() {
* @brief Get the value of the sigchain key
* @retval bool, true if set the value of the key,or false.
*/
static
bool
get_handling_signal
()
{
static
bool
get_handling_signal
()
{
void
*
result
=
pthread_getspecific
(
get_handling_signal_key
());
if
(
result
==
NULL
)
{
return
false
;
...
...
@@ -120,14 +125,14 @@ bool ismarked(int signo)
static
void
signal_chain_handler
(
int
signo
,
siginfo_t
*
siginfo
,
void
*
ucontext_raw
)
{
SIGCHAIN_PRINT_DEBUG
(
"%{public}s signo: %{public}d"
,
__func__
,
signo
);
/*
Try to call the special handlers first
. */
/* If
one of them crashes, we'll reenter this handler and pass that crash onto the user handler.
*/
if
(
!
get_handling_signal
()){
/*
First call special handler
. */
/* If
a process crashes, the sigchain'll call the corresponding handler
*/
if
(
!
get_handling_signal
())
{
for
(
int
i
=
0
;
i
<
SIGNAL_CHAIN_SPECIAL_ACTION_MAX
;
i
++
)
{
if
(
sig_chains
[
signo
-
1
].
sca_special_actions
[
i
].
sca_sigaction
==
NULL
)
{
break
;
}
/* The
native bridge sign
al handler might not return. */
/* The
speci
al handler might not return. */
bool
noreturn
=
(
sig_chains
[
signo
-
1
].
sca_special_actions
[
i
].
sca_flags
&
SIGCHAIN_ALLOW_NORETURN
);
sigset_t
previous_mask
;
...
...
@@ -149,7 +154,7 @@ static void signal_chain_handler(int signo, siginfo_t* siginfo, void* ucontext_r
set_handling_signal
(
previous_value
);
}
}
/* Then Call the user's signal handler */
int
sa_flags
=
sig_chains
[
signo
-
1
].
sig_action
.
sa_flags
;
ucontext_t
*
ucontext
=
(
ucontext_t
*
)(
ucontext_raw
);
...
...
@@ -289,7 +294,7 @@ void add_special_signal_handler(int signo, struct signal_chain_action* sa)
return
;
}
//
Set the special handler.
//
Add the special hander to the sigchain
add_special_handler
(
signo
,
sa
);
mark_signal_to_sigchain
(
signo
);
}
...
...
@@ -307,7 +312,7 @@ void remove_special_signal_handler(int signo, bool (*fn)(int, siginfo_t*, void*)
SIGCHAIN_PRINT_ERROR
(
"%{public}s Invalid signal %{public}d"
,
__func__
,
signo
);
return
;
}
// remove the special handler.
// remove the special handler
from the sigchain
.
rm_special_handler
(
signo
,
fn
);
}
...
...
@@ -351,7 +356,7 @@ bool intercept_sigaction(int signo, const struct sigaction *restrict sa,
void
intercept_sigprocmask
(
int
how
,
sigset_t
*
restrict
set
)
{
SIGCHAIN_PRINT_DEBUG
(
"%{public}s how: %{public}d"
,
__func__
,
how
);
// Forward directly to the pthread_sigmask When this sigchain is
inside a signal handler
// Forward directly to the pthread_sigmask When this sigchain is
handling a signal.
if
(
get_handling_signal
())
{
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录