Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
a2dcb44c
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a2dcb44c
编写于
4月 23, 2008
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] make osf_select() use core_sys_select()
... instead of open-coding it Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
bf7da7bc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
7 addition
and
66 deletion
+7
-66
arch/alpha/kernel/osf_sys.c
arch/alpha/kernel/osf_sys.c
+4
-65
fs/select.c
fs/select.c
+1
-1
include/linux/poll.h
include/linux/poll.h
+2
-0
未找到文件。
arch/alpha/kernel/osf_sys.c
浏览文件 @
a2dcb44c
...
...
@@ -981,27 +981,18 @@ asmlinkage int
osf_select
(
int
n
,
fd_set
__user
*
inp
,
fd_set
__user
*
outp
,
fd_set
__user
*
exp
,
struct
timeval32
__user
*
tvp
)
{
fd_set_bits
fds
;
char
*
bits
;
size_t
size
;
long
timeout
;
int
ret
=
-
EINVAL
;
struct
fdtable
*
fdt
;
int
max_fds
;
timeout
=
MAX_SCHEDULE_TIMEOUT
;
s64
timeout
=
MAX_SCHEDULE_TIMEOUT
;
if
(
tvp
)
{
time_t
sec
,
usec
;
if
(
!
access_ok
(
VERIFY_READ
,
tvp
,
sizeof
(
*
tvp
))
||
__get_user
(
sec
,
&
tvp
->
tv_sec
)
||
__get_user
(
usec
,
&
tvp
->
tv_usec
))
{
ret
=
-
EFAULT
;
goto
out_nofds
;
return
-
EFAULT
;
}
if
(
sec
<
0
||
usec
<
0
)
goto
out_nofds
;
return
-
EINVAL
;
if
((
unsigned
long
)
sec
<
MAX_SELECT_SECONDS
)
{
timeout
=
(
usec
+
1000000
/
HZ
-
1
)
/
(
1000000
/
HZ
);
...
...
@@ -1009,60 +1000,8 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
}
}
rcu_read_lock
();
fdt
=
files_fdtable
(
current
->
files
);
max_fds
=
fdt
->
max_fds
;
rcu_read_unlock
();
if
(
n
<
0
||
n
>
max_fds
)
goto
out_nofds
;
/*
* We need 6 bitmaps (in/out/ex for both incoming and outgoing),
* since we used fdset we need to allocate memory in units of
* long-words.
*/
ret
=
-
ENOMEM
;
size
=
FDS_BYTES
(
n
);
bits
=
kmalloc
(
6
*
size
,
GFP_KERNEL
);
if
(
!
bits
)
goto
out_nofds
;
fds
.
in
=
(
unsigned
long
*
)
bits
;
fds
.
out
=
(
unsigned
long
*
)
(
bits
+
size
);
fds
.
ex
=
(
unsigned
long
*
)
(
bits
+
2
*
size
);
fds
.
res_in
=
(
unsigned
long
*
)
(
bits
+
3
*
size
);
fds
.
res_out
=
(
unsigned
long
*
)
(
bits
+
4
*
size
);
fds
.
res_ex
=
(
unsigned
long
*
)
(
bits
+
5
*
size
);
if
((
ret
=
get_fd_set
(
n
,
inp
->
fds_bits
,
fds
.
in
))
||
(
ret
=
get_fd_set
(
n
,
outp
->
fds_bits
,
fds
.
out
))
||
(
ret
=
get_fd_set
(
n
,
exp
->
fds_bits
,
fds
.
ex
)))
goto
out
;
zero_fd_set
(
n
,
fds
.
res_in
);
zero_fd_set
(
n
,
fds
.
res_out
);
zero_fd_set
(
n
,
fds
.
res_ex
);
ret
=
do_select
(
n
,
&
fds
,
&
timeout
);
/* OSF does not copy back the remaining time. */
if
(
ret
<
0
)
goto
out
;
if
(
!
ret
)
{
ret
=
-
ERESTARTNOHAND
;
if
(
signal_pending
(
current
))
goto
out
;
ret
=
0
;
}
if
(
set_fd_set
(
n
,
inp
->
fds_bits
,
fds
.
res_in
)
||
set_fd_set
(
n
,
outp
->
fds_bits
,
fds
.
res_out
)
||
set_fd_set
(
n
,
exp
->
fds_bits
,
fds
.
res_ex
))
ret
=
-
EFAULT
;
out:
kfree
(
bits
);
out_nofds:
return
ret
;
return
core_sys_select
(
n
,
inp
,
outp
,
exp
,
&
timeout
);
}
struct
rusage32
{
...
...
fs/select.c
浏览文件 @
a2dcb44c
...
...
@@ -298,7 +298,7 @@ int do_select(int n, fd_set_bits *fds, s64 *timeout)
#define MAX_SELECT_SECONDS \
((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
static
int
core_sys_select
(
int
n
,
fd_set
__user
*
inp
,
fd_set
__user
*
outp
,
int
core_sys_select
(
int
n
,
fd_set
__user
*
inp
,
fd_set
__user
*
outp
,
fd_set
__user
*
exp
,
s64
*
timeout
)
{
fd_set_bits
fds
;
...
...
include/linux/poll.h
浏览文件 @
a2dcb44c
...
...
@@ -117,6 +117,8 @@ void zero_fd_set(unsigned long nr, unsigned long *fdset)
extern
int
do_select
(
int
n
,
fd_set_bits
*
fds
,
s64
*
timeout
);
extern
int
do_sys_poll
(
struct
pollfd
__user
*
ufds
,
unsigned
int
nfds
,
s64
*
timeout
);
extern
int
core_sys_select
(
int
n
,
fd_set
__user
*
inp
,
fd_set
__user
*
outp
,
fd_set
__user
*
exp
,
s64
*
timeout
);
#endif
/* KERNEL */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录