- sys_stime() takes an int*, but it should be a time_t*: they have different
  sizes on (for example) sparc64.

- sys_settimeofday() is confusing timevals with timespecs.  They have
  different sizes on sparc64 and the time keep son getting set to epoch.



 kernel/time.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff -puN kernel/time.c~settimeofday-fix kernel/time.c
--- 25/kernel/time.c~settimeofday-fix	2003-07-15 17:24:51.000000000 -0700
+++ 25-akpm/kernel/time.c	2003-07-15 17:24:56.000000000 -0700
@@ -66,7 +66,7 @@ asmlinkage long sys_time(int * tloc)
  * architectures that need it).
  */
  
-asmlinkage long sys_stime(int * tptr)
+asmlinkage long sys_stime(time_t *tptr)
 {
 	struct timespec tv;
 
@@ -160,22 +160,25 @@ int do_sys_settimeofday(struct timespec 
 	return 0;
 }
 
-asmlinkage long sys_settimeofday(struct timeval __user *tv, struct timezone __user *tz)
+asmlinkage long sys_settimeofday(struct timeval __user *tv,
+				struct timezone __user *tz)
 {
-	struct timespec	new_tv;
+	struct timeval user_tv;
+	struct timespec	new_ts;
 	struct timezone new_tz;
 
 	if (tv) {
-		if (copy_from_user(&new_tv, tv, sizeof(*tv)))
+		if (copy_from_user(&user_tv, tv, sizeof(*tv)))
 			return -EFAULT;
-		new_tv.tv_nsec *= NSEC_PER_USEC;
+		new_ts.tv_sec = user_tv.tv_sec;
+		new_ts.tv_nsec = user_tv.tv_usec * NSEC_PER_USEC;
 	}
 	if (tz) {
 		if (copy_from_user(&new_tz, tz, sizeof(*tz)))
 			return -EFAULT;
 	}
 
-	return do_sys_settimeofday(tv ? &new_tv : NULL, tz ? &new_tz : NULL);
+	return do_sys_settimeofday(tv ? &new_ts : NULL, tz ? &new_tz : NULL);
 }
 
 long pps_offset;		/* pps time offset (us) */

_