diff options
| author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2005-01-04 05:29:47 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-04 05:29:47 -0800 |
| commit | 8fa29920db547f6d0e7729533be5ccf0a005b89b (patch) | |
| tree | 72bae7d3598103f2484be9aaca46c928a4c542cf /kernel/time.c | |
| parent | d6326c182030bcae0bb0b35d681720e23aa8a88b (diff) | |
[PATCH] sys_stime needs a compat function
I realized that the best way to get the sys_time/sys_stime problem fixed is
to make sys_time 64 bit safe by using "time_t *" instead of "int *" and to
introduce two proper compat functions compat_sys_time and compat_sys_stime.
The prototype change of sys_time is transparent for 32 bit architectures
because both "int" and "time_t" are 32 bit. For 64 bit the type change
would be wrong but luckily no 64 bit architecture uses sys_time/sys_stime
in 64 bit mode. The patch makes the following change:
ia64 : Remove sys32_time, use compat_sys_time and
add (!!) compat_sys_stime to compat syscall table.
mips : Use compat_sys_time/compat_sys_stime in 32 bit syscall table.
Add #ifdef magic to compile sys_time/sys_stime and
compat_sys_time/compat_sys_stime only if needed.
parisc : Remove sys32_time, use compat_sys_time and compat_sys_stime.
ppc64 : remove sys32_time, ppc64_sys32_stime and ppc64_sys_stime.
Use common compat_sys_time, compat_sys_stime and sys_stime.
s390 : Use compat_sys_stime. Add #ifdef magic to compile
sys_time/sys_stime and compat_sys_time/compat_sys_stime only
if needed.
sparc64 : Use compat_sys_time/compat_Sys_stime in 32 bit syscall table.
um : Remove um_time and um_stime. Use common functions sys_time and
sys_stime. This adds a CAP_SYS_TIME check to UMs stime call.
x86_64 : Remove sys32_time. Use compat_sys_time and compat_sys_stime
in 32 bit syscall table.
The original stime bug is fixed for mips, parisc, s390, sparc64 and
x86_64. Can the arch-maintainers please take a look at this?
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
Convert compat_time_t to time_t in 32 bit emulation for sys_stime and
consolidate all the different implementation of sys_time, sys_stime and
their 32-bit emulation parts.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/time.c')
| -rw-r--r-- | kernel/time.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/time.c b/kernel/time.c index b6d01cf709c4..5ceab525f203 100644 --- a/kernel/time.c +++ b/kernel/time.c @@ -52,12 +52,10 @@ EXPORT_SYMBOL(sys_tz); * sys_gettimeofday(). Is this for backwards compatibility? If so, * why not move it into the appropriate arch directory (for those * architectures that need it). - * - * XXX This function is NOT 64-bit clean! */ -asmlinkage long sys_time(int __user * tloc) +asmlinkage long sys_time(time_t __user * tloc) { - int i; + time_t i; struct timeval tv; do_gettimeofday(&tv); |
