Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
49d72afc
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
1 年多 前同步成功
通知
467
Star
414
Fork
55
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
49d72afc
编写于
3月 28, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 28, 2022
浏览文件
操作
浏览文件
下载
差异文件
!810 fix:优化修改epoll系统调用接口
Merge pull request !810 from Kiita/220224_epoll
上级
faeeaf29
c11ff678
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
30 deletion
+19
-30
fs/vfs/epoll/fs_epoll.c
fs/vfs/epoll/fs_epoll.c
+8
-8
fs/vfs/include/epoll.h
fs/vfs/include/epoll.h
+1
-1
syscall/fs_syscall.c
syscall/fs_syscall.c
+10
-21
未找到文件。
fs/vfs/epoll/fs_epoll.c
浏览文件 @
49d72afc
...
...
@@ -164,23 +164,23 @@ static VOID DoEpollClose(struct epoll_head *epHead)
}
/**
* epoll_create,
* epoll_create unsupported api
*
* epoll_create is implemented by calling epoll_create1, it's parameter 'size' is useless.
*
* epoll_create1,
* The simple version of epoll does not use red-black trees,
* so when fd is normal value (greater than 0),
* actually allocated epoll can manage num of EPOLL_DEFAULT_SIZE
*
* @param
size
: not actually used
* @param
flags
: not actually used
* @return epoll fd
*/
int
epoll_create
(
int
size
)
int
epoll_create
1
(
int
flags
)
{
(
void
)
flags
;
int
fd
=
-
1
;
if
(
size
<=
0
)
{
set_errno
(
EINVAL
);
return
fd
;
}
struct
epoll_head
*
epHead
=
(
struct
epoll_head
*
)
malloc
(
sizeof
(
struct
epoll_head
));
if
(
epHead
==
NULL
)
{
set_errno
(
ENOMEM
);
...
...
fs/vfs/include/epoll.h
浏览文件 @
49d72afc
...
...
@@ -72,7 +72,7 @@ struct epoll_event {
epoll_data_t
data
;
};
int
epoll_create
(
int
size
);
int
epoll_create
1
(
int
flags
);
int
epoll_close
(
int
epfd
);
int
epoll_ctl
(
int
epfd
,
int
op
,
int
fd
,
struct
epoll_event
*
ev
);
int
epoll_wait
(
int
epfd
,
FAR
struct
epoll_event
*
evs
,
int
maxevents
,
int
timeout
);
...
...
syscall/fs_syscall.c
浏览文件 @
49d72afc
...
...
@@ -2601,18 +2601,15 @@ int SysPselect6(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
return
ret
;
}
int
SysEpollCreate
(
int
size
)
static
int
DoEpollCreate1
(
int
flags
)
{
int
ret
;
int
procFd
;
if
(
size
<=
0
)
{
return
-
EINVAL
;
}
ret
=
epoll_create
(
size
);
ret
=
epoll_create1
(
flags
);
if
(
ret
<
0
)
{
ret
=
-
get_errno
();
return
ret
;
}
procFd
=
AllocAndAssocProcessFd
((
INTPTR
)(
ret
),
MIN_START_FD
);
...
...
@@ -2624,23 +2621,15 @@ int SysEpollCreate(int size)
return
procFd
;
}
int
SysEpollCreate
1
(
int
flags
)
int
SysEpollCreate
(
int
size
)
{
int
ret
;
int
procFd
;
ret
=
epoll_create
(
flags
);
if
(
ret
<
0
)
{
ret
=
-
get_errno
();
}
procFd
=
AllocAndAssocProcessFd
((
INTPTR
)(
ret
),
MIN_START_FD
);
if
(
procFd
==
-
1
)
{
epoll_close
(
ret
);
return
-
EMFILE
;
}
(
void
)
size
;
return
DoEpollCreate1
(
0
);
}
return
procFd
;
int
SysEpollCreate1
(
int
flags
)
{
return
DoEpollCreate1
(
flags
);
}
int
SysEpollCtl
(
int
epfd
,
int
op
,
int
fd
,
struct
epoll_event
*
ev
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录