Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
7e95a225
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
157
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7e95a225
编写于
5月 14, 2017
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move compat wait4 and waitid next to native variants
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
a8c39544
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
69 addition
and
66 deletion
+69
-66
kernel/compat.c
kernel/compat.c
+0
-66
kernel/exit.c
kernel/exit.c
+69
-0
未找到文件。
kernel/compat.c
浏览文件 @
7e95a225
...
@@ -543,72 +543,6 @@ int put_compat_rusage(const struct rusage *r, struct compat_rusage __user *ru)
...
@@ -543,72 +543,6 @@ int put_compat_rusage(const struct rusage *r, struct compat_rusage __user *ru)
return
0
;
return
0
;
}
}
COMPAT_SYSCALL_DEFINE4
(
wait4
,
compat_pid_t
,
pid
,
compat_uint_t
__user
*
,
stat_addr
,
int
,
options
,
struct
compat_rusage
__user
*
,
ru
)
{
if
(
!
ru
)
{
return
sys_wait4
(
pid
,
stat_addr
,
options
,
NULL
);
}
else
{
struct
rusage
r
;
int
ret
;
unsigned
int
status
;
mm_segment_t
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
ret
=
sys_wait4
(
pid
,
(
stat_addr
?
(
unsigned
int
__user
*
)
&
status
:
NULL
),
options
,
(
struct
rusage
__user
*
)
&
r
);
set_fs
(
old_fs
);
if
(
ret
>
0
)
{
if
(
put_compat_rusage
(
&
r
,
ru
))
return
-
EFAULT
;
if
(
stat_addr
&&
put_user
(
status
,
stat_addr
))
return
-
EFAULT
;
}
return
ret
;
}
}
COMPAT_SYSCALL_DEFINE5
(
waitid
,
int
,
which
,
compat_pid_t
,
pid
,
struct
compat_siginfo
__user
*
,
uinfo
,
int
,
options
,
struct
compat_rusage
__user
*
,
uru
)
{
siginfo_t
info
;
struct
rusage
ru
;
long
ret
;
mm_segment_t
old_fs
=
get_fs
();
memset
(
&
info
,
0
,
sizeof
(
info
));
set_fs
(
KERNEL_DS
);
ret
=
sys_waitid
(
which
,
pid
,
(
siginfo_t
__user
*
)
&
info
,
options
,
uru
?
(
struct
rusage
__user
*
)
&
ru
:
NULL
);
set_fs
(
old_fs
);
if
((
ret
<
0
)
||
(
info
.
si_signo
==
0
))
return
ret
;
if
(
uru
)
{
/* sys_waitid() overwrites everything in ru */
if
(
COMPAT_USE_64BIT_TIME
)
ret
=
copy_to_user
(
uru
,
&
ru
,
sizeof
(
ru
));
else
ret
=
put_compat_rusage
(
&
ru
,
uru
);
if
(
ret
)
return
-
EFAULT
;
}
BUG_ON
(
info
.
si_code
&
__SI_MASK
);
info
.
si_code
|=
__SI_CHLD
;
return
copy_siginfo_to_user32
(
uinfo
,
&
info
);
}
static
int
compat_get_user_cpu_mask
(
compat_ulong_t
__user
*
user_mask_ptr
,
static
int
compat_get_user_cpu_mask
(
compat_ulong_t
__user
*
user_mask_ptr
,
unsigned
len
,
struct
cpumask
*
new_mask
)
unsigned
len
,
struct
cpumask
*
new_mask
)
{
{
...
...
kernel/exit.c
浏览文件 @
7e95a225
...
@@ -62,6 +62,7 @@
...
@@ -62,6 +62,7 @@
#include <linux/kcov.h>
#include <linux/kcov.h>
#include <linux/random.h>
#include <linux/random.h>
#include <linux/rcuwait.h>
#include <linux/rcuwait.h>
#include <linux/compat.h>
#include <linux/uaccess.h>
#include <linux/uaccess.h>
#include <asm/unistd.h>
#include <asm/unistd.h>
...
@@ -1735,3 +1736,71 @@ SYSCALL_DEFINE3(waitpid, pid_t, pid, int __user *, stat_addr, int, options)
...
@@ -1735,3 +1736,71 @@ SYSCALL_DEFINE3(waitpid, pid_t, pid, int __user *, stat_addr, int, options)
}
}
#endif
#endif
#ifdef CONFIG_COMPAT
COMPAT_SYSCALL_DEFINE4
(
wait4
,
compat_pid_t
,
pid
,
compat_uint_t
__user
*
,
stat_addr
,
int
,
options
,
struct
compat_rusage
__user
*
,
ru
)
{
if
(
!
ru
)
{
return
sys_wait4
(
pid
,
stat_addr
,
options
,
NULL
);
}
else
{
struct
rusage
r
;
int
ret
;
unsigned
int
status
;
mm_segment_t
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
ret
=
sys_wait4
(
pid
,
(
stat_addr
?
(
unsigned
int
__user
*
)
&
status
:
NULL
),
options
,
(
struct
rusage
__user
*
)
&
r
);
set_fs
(
old_fs
);
if
(
ret
>
0
)
{
if
(
put_compat_rusage
(
&
r
,
ru
))
return
-
EFAULT
;
if
(
stat_addr
&&
put_user
(
status
,
stat_addr
))
return
-
EFAULT
;
}
return
ret
;
}
}
COMPAT_SYSCALL_DEFINE5
(
waitid
,
int
,
which
,
compat_pid_t
,
pid
,
struct
compat_siginfo
__user
*
,
infop
,
int
,
options
,
struct
compat_rusage
__user
*
,
uru
)
{
siginfo_t
info
;
struct
rusage
ru
;
long
ret
;
mm_segment_t
old_fs
=
get_fs
();
memset
(
&
info
,
0
,
sizeof
(
info
));
set_fs
(
KERNEL_DS
);
ret
=
sys_waitid
(
which
,
pid
,
(
siginfo_t
__user
*
)
&
info
,
options
,
uru
?
(
struct
rusage
__user
*
)
&
ru
:
NULL
);
set_fs
(
old_fs
);
if
((
ret
<
0
)
||
(
info
.
si_signo
==
0
))
return
ret
;
if
(
uru
)
{
/* sys_waitid() overwrites everything in ru */
if
(
COMPAT_USE_64BIT_TIME
)
ret
=
copy_to_user
(
uru
,
&
ru
,
sizeof
(
ru
));
else
ret
=
put_compat_rusage
(
&
ru
,
uru
);
if
(
ret
)
return
-
EFAULT
;
}
BUG_ON
(
info
.
si_code
&
__SI_MASK
);
info
.
si_code
|=
__SI_CHLD
;
return
copy_siginfo_to_user32
(
infop
,
&
info
);
}
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录