Commit 275f469e authored by David S. Miller's avatar David S. Miller

[SPARC64]: Update sys32_settimeofday for do_settimeofday() changes.

parent 0f7923d7
...@@ -2312,7 +2312,6 @@ int asmlinkage sys32_nfsservctl(int cmd, void *notused, void *notused2) ...@@ -2312,7 +2312,6 @@ int asmlinkage sys32_nfsservctl(int cmd, void *notused, void *notused2)
sorts of things, like timeval and itimerval. */ sorts of things, like timeval and itimerval. */
extern struct timezone sys_tz; extern struct timezone sys_tz;
extern int do_sys_settimeofday(struct timeval *tv, struct timezone *tz);
asmlinkage int sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz) asmlinkage int sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz)
{ {
...@@ -2329,13 +2328,27 @@ asmlinkage int sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz ...@@ -2329,13 +2328,27 @@ asmlinkage int sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz
return 0; return 0;
} }
static inline long get_ts32(struct timespec *o, struct compat_timeval *i)
{
long usec;
if (!access_ok(VERIFY_READ, i, sizeof(*i)))
return -EFAULT;
if (__get_user(o->tv_sec, &i->tv_sec))
return -EFAULT;
if (__get_user(usec, &i->tv_usec))
return -EFAULT;
o->tv_nsec = usec * 1000;
return 0;
}
asmlinkage int sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz) asmlinkage int sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz)
{ {
struct timeval ktv; struct timespec kts;
struct timezone ktz; struct timezone ktz;
if (tv) { if (tv) {
if (get_tv32(&ktv, tv)) if (get_ts32(&kts, tv))
return -EFAULT; return -EFAULT;
} }
if (tz) { if (tz) {
...@@ -2343,7 +2356,7 @@ asmlinkage int sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz ...@@ -2343,7 +2356,7 @@ asmlinkage int sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz
return -EFAULT; return -EFAULT;
} }
return do_sys_settimeofday(tv ? &ktv : NULL, tz ? &ktz : NULL); return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
} }
asmlinkage int sys32_utimes(char *filename, struct compat_timeval *tvs) asmlinkage int sys32_utimes(char *filename, struct compat_timeval *tvs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment