提交 614adcd9 编写于 作者: D dhy308

Fix review issues

Issue: I6AEEI
Test: Build & Boot Devices
Signed-off-by: Ndhy308 <tony.gan@huawei.com>
上级 246336cc
/*
* 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.
*/
#ifndef _SIGCHAIN_H
#define _SIGCHAIN_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <signal.h>
#include <stdint.h>
#include <stdbool.h>
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;
};
/* Mark the signal to the sigchain, add the special handler to the sigchain. */
void add_special_signal_handler(int signo, struct signal_chain_action* sa);
/* Remove the special the handler form the sigchain. */
void remove_special_signal_handler(int signo, bool (*fn)(int, siginfo_t*, void*));
#ifdef __cplusplus
}
#endif
#endif
\ No newline at end of file
......@@ -46,4 +46,4 @@ functionalext_sigchain_list = [
"sigchain_intercept_sigprocmask_b",
"sigchain_intercept_sigprocmask_c",
"sigchain_intercept_sigprocmask_d",
]
\ No newline at end of file
]
/*
* 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.
*/
#ifndef _SIGCHAIN_H
#define _SIGCHAIN_H
#ifdef __cplusplus
extern "C" {
#endif
#define _GNU_SOURCE
#include <signal.h>
#include <stdint.h>
#include <stdbool.h>
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;
};
/* Mark the signal to the sigchain, add the special handler to the sigchain. */
void add_special_signal_handler(int signo, struct signal_chain_action* sa);
/* Remove the special the handler form the sigchain. */
void remove_special_signal_handler(int signo, bool (*fn)(int, siginfo_t*, void*));
#ifdef __cplusplus
}
#endif
#endif
\ No newline at end of file
......@@ -351,6 +351,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
if (get_handling_signal()) {
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册