summaryrefslogtreecommitdiff
blob: c9688e7a69e8bcaf0d871374af2c70bcd428d740 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Index: linux-2.6.16/include/linux/vs_time.h
===================================================================
--- linux-2.6.16.orig/include/linux/vs_time.h
+++ linux-2.6.16/include/linux/vs_time.h
@@ -7,7 +7,7 @@
 #ifdef CONFIG_VSERVER_VTIME
 
 extern void vx_gettimeofday(struct timeval *tv);
-extern int vx_settimeofday(struct timeval *tv);
+extern int vx_settimeofday(struct timespec *ts);
 
 #else
 #define	vx_gettimeofday(t)	do_gettimeofday(t)
Index: linux-2.6.16/kernel/vserver/cvirt.c
===================================================================
--- linux-2.6.16.orig/kernel/vserver/cvirt.c
+++ linux-2.6.16/kernel/vserver/cvirt.c
@@ -278,18 +278,18 @@ void vx_gettimeofday(struct timeval *tv)
 	}
 }
 
-int vx_settimeofday(struct timeval *tv)
+int vx_settimeofday(struct timespec *ts)
 {
-	struct timeval tvs;
+	struct timeval tv;
 
 	if (!vx_flags(VXF_VIRT_TIME, 0))
-		return do_settimeofday(tv);
+		return do_settimeofday(ts);
 
-	do_gettimeofday(&tvs);
+	do_gettimeofday(&tv);
 	current->vx_info->cvirt.bias_tv.tv_sec =
-		tv->tv_sec - tvs.tv_sec;
+		ts->tv_sec - tv.tv_sec;
 	current->vx_info->cvirt.bias_tv.tv_usec =
-		tv->tv_usec - tvs.tv_usec;
+		(ts->tv_nsec/NSEC_PER_USEC) - tv.tv_usec;
 	return 0;
 }