summaryrefslogtreecommitdiffstats
path: root/kernel/time.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-12-16 05:34:03 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-12-16 05:34:03 +0000
commit967c65a99059fd459b956c1588ce0ba227912c4e (patch)
tree8224d013ff5d255420713d05610c7efebd204d2a /kernel/time.c
parente20c1cc1656a66a2773bca4591a895cbc12696ff (diff)
Merge with Linux 2.1.72, part 1.
Diffstat (limited to 'kernel/time.c')
-rw-r--r--kernel/time.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/kernel/time.c b/kernel/time.c
index 7ba688b60..7927c2aa1 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -151,25 +151,17 @@ inline static void warp_clock(void)
* as soon as possible, so that the clock can be set right. Otherwise,
* various programs will get confused when the clock gets warped.
*/
-asmlinkage int sys_settimeofday(struct timeval *tv, struct timezone *tz)
+
+int do_sys_settimeofday(struct timeval *tv, struct timezone *tz)
{
- static int firsttime = 1;
- struct timeval new_tv;
- struct timezone new_tz;
+ static int firsttime = 1;
if (!suser())
return -EPERM;
- if (tv) {
- if (copy_from_user(&new_tv, tv, sizeof(*tv)))
- return -EFAULT;
- }
if (tz) {
- if (copy_from_user(&new_tz, tz, sizeof(*tz)))
- return -EFAULT;
-
/* SMP safe, global irq locking makes it work. */
- sys_tz = new_tz;
+ sys_tz = *tz;
if (firsttime) {
firsttime = 0;
if (!tv)
@@ -181,11 +173,28 @@ asmlinkage int sys_settimeofday(struct timeval *tv, struct timezone *tz)
/* SMP safe, again the code in arch/foo/time.c should
* globally block out interrupts when it runs.
*/
- do_settimeofday(&new_tv);
+ do_settimeofday(tv);
}
return 0;
}
+asmlinkage int sys_settimeofday(struct timeval *tv, struct timezone *tz)
+{
+ struct timeval new_tv;
+ struct timezone new_tz;
+
+ if (tv) {
+ if (copy_from_user(&new_tv, tv, sizeof(*tv)))
+ return -EFAULT;
+ }
+ 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);
+}
+
long pps_offset = 0; /* pps time offset (us) */
long pps_jitter = MAXTIME; /* time dispersion (jitter) (us) */