Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
ca2406ed
Commit
ca2406ed
authored
May 31, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
times(2): move compat to native
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
1e1fc133
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
28 deletions
+27
-28
include/linux/time.h
include/linux/time.h
+0
-3
kernel/compat.c
kernel/compat.c
+0
-24
kernel/sys.c
kernel/sys.c
+27
-1
No files found.
include/linux/time.h
View file @
ca2406ed
...
...
@@ -171,9 +171,6 @@ extern int do_getitimer(int which, struct itimerval *value);
extern
long
do_utimes
(
int
dfd
,
const
char
__user
*
filename
,
struct
timespec
*
times
,
int
flags
);
struct
tms
;
extern
void
do_sys_times
(
struct
tms
*
);
/*
* Similar to the struct tm in userspace <time.h>, but it needs to be here so
* that the kernel source is self contained.
...
...
kernel/compat.c
View file @
ca2406ed
...
...
@@ -350,30 +350,6 @@ COMPAT_SYSCALL_DEFINE3(setitimer, int, which,
return
0
;
}
static
compat_clock_t
clock_t_to_compat_clock_t
(
clock_t
x
)
{
return
compat_jiffies_to_clock_t
(
clock_t_to_jiffies
(
x
));
}
COMPAT_SYSCALL_DEFINE1
(
times
,
struct
compat_tms
__user
*
,
tbuf
)
{
if
(
tbuf
)
{
struct
tms
tms
;
struct
compat_tms
tmp
;
do_sys_times
(
&
tms
);
/* Convert our struct tms to the compat version. */
tmp
.
tms_utime
=
clock_t_to_compat_clock_t
(
tms
.
tms_utime
);
tmp
.
tms_stime
=
clock_t_to_compat_clock_t
(
tms
.
tms_stime
);
tmp
.
tms_cutime
=
clock_t_to_compat_clock_t
(
tms
.
tms_cutime
);
tmp
.
tms_cstime
=
clock_t_to_compat_clock_t
(
tms
.
tms_cstime
);
if
(
copy_to_user
(
tbuf
,
&
tmp
,
sizeof
(
tmp
)))
return
-
EFAULT
;
}
force_successful_syscall_return
();
return
compat_jiffies_to_clock_t
(
jiffies
);
}
#ifdef __ARCH_WANT_SYS_SIGPENDING
/*
...
...
kernel/sys.c
View file @
ca2406ed
...
...
@@ -886,7 +886,7 @@ SYSCALL_DEFINE0(getegid)
return
from_kgid_munged
(
current_user_ns
(),
current_egid
());
}
void
do_sys_times
(
struct
tms
*
tms
)
static
void
do_sys_times
(
struct
tms
*
tms
)
{
u64
tgutime
,
tgstime
,
cutime
,
cstime
;
...
...
@@ -912,6 +912,32 @@ SYSCALL_DEFINE1(times, struct tms __user *, tbuf)
return
(
long
)
jiffies_64_to_clock_t
(
get_jiffies_64
());
}
#ifdef CONFIG_COMPAT
static
compat_clock_t
clock_t_to_compat_clock_t
(
clock_t
x
)
{
return
compat_jiffies_to_clock_t
(
clock_t_to_jiffies
(
x
));
}
COMPAT_SYSCALL_DEFINE1
(
times
,
struct
compat_tms
__user
*
,
tbuf
)
{
if
(
tbuf
)
{
struct
tms
tms
;
struct
compat_tms
tmp
;
do_sys_times
(
&
tms
);
/* Convert our struct tms to the compat version. */
tmp
.
tms_utime
=
clock_t_to_compat_clock_t
(
tms
.
tms_utime
);
tmp
.
tms_stime
=
clock_t_to_compat_clock_t
(
tms
.
tms_stime
);
tmp
.
tms_cutime
=
clock_t_to_compat_clock_t
(
tms
.
tms_cutime
);
tmp
.
tms_cstime
=
clock_t_to_compat_clock_t
(
tms
.
tms_cstime
);
if
(
copy_to_user
(
tbuf
,
&
tmp
,
sizeof
(
tmp
)))
return
-
EFAULT
;
}
force_successful_syscall_return
();
return
compat_jiffies_to_clock_t
(
jiffies
);
}
#endif
/*
* This needs some heavy checking ...
* I just haven't the stomach for it. I also don't fully
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment