代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 17fa541e456acccae61669fcc403b44e4aabb2d5 Mon Sep 17 00:00:00 2001
From: wuchangsheng <wuchangsheng2@huawei.com>
Date: Thu, 21 Apr 2022 16:59:44 +0800
Subject: [PATCH 08/18] add kernel path in epoll funcs
---
src/lstack/api/lstack_wrap.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/src/lstack/api/lstack_wrap.c b/src/lstack/api/lstack_wrap.c
index 0164069..f623da3 100644
--- a/src/lstack/api/lstack_wrap.c
+++ b/src/lstack/api/lstack_wrap.c
@@ -77,6 +77,15 @@ static inline enum KERNEL_LWIP_PATH select_path(int fd)
static inline int32_t do_epoll_create(int32_t size)
{
+ if (posix_api == NULL) {
+ /* link liblstack.so using LD_PRELOAD mode will read liblstack.so,
+ poisx_api need to be initialized here */
+ if (posix_api_init() != 0) {
+ LSTACK_PRE_LOG(LSTACK_ERR, "posix_api_init failed\n");
+ }
+ return posix_api->epoll_create_fn(size);
+ }
+
if (unlikely(posix_api->is_chld)) {
return posix_api->epoll_create_fn(size);
}
@@ -90,16 +99,22 @@ static inline int32_t do_epoll_ctl(int32_t epfd, int32_t op, int32_t fd, struct
return posix_api->epoll_ctl_fn(epfd, op, fd, event);
}
+ struct lwip_sock *sock = get_socket_by_fd(epfd);
+ if (sock == NULL || sock->wakeup == NULL) {
+ return posix_api->epoll_ctl_fn(epfd, op, fd, event);
+ }
+
return lstack_epoll_ctl(epfd, op, fd, event);
}
static inline int32_t do_epoll_wait(int32_t epfd, struct epoll_event* events, int32_t maxevents, int32_t timeout)
{
- if (events == NULL || maxevents == 0) {
- GAZELLE_RETURN(EINVAL);
+ if (unlikely(posix_api->is_chld)) {
+ return posix_api->epoll_wait_fn(epfd, events, maxevents, timeout);
}
- if (unlikely(posix_api->is_chld)) {
+ struct lwip_sock *sock = get_socket_by_fd(epfd);
+ if (sock == NULL || sock->wakeup == NULL) {
return posix_api->epoll_wait_fn(epfd, events, maxevents, timeout);
}
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。