summarylogtreecommitdiffstats
path: root/0002a-kernel-5.0.0-do_gettimeofday.patch
blob: caa56d77e803ee0af352eeaf3df16f2611a20c91 (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
--- driver/2.6.27/dgrp_mon_ops.c.orig	2018-06-01 12:10:27.000000000 -0400
+++ driver/2.6.27/dgrp_mon_ops.c	2020-07-02 21:48:51.158972983 -0400
@@ -319,23 +319,33 @@
 			 *  Enter an RPDUMP file header into the buffer.
 			 */
 
 			uchar *buf = nd->nd_mon_buf;
 			uint  time;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
 			struct timeval tv;
+#else
+			struct timespec64 ts;
+#endif
 
 			strcpy(buf, RPDUMP_MAGIC);
 			buf += strlen(buf) + 1;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
 			do_gettimeofday(&tv);
 
 			/*
 			 *  tv.tv_sec might be a 64 bit quantity.  Pare
 			 *  it down to 32 bits before attempting to encode
 			 *  it.
 			 */
 			time = (uint) (tv.tv_sec & 0xffffffff);
+#else
+			ktime_get_real_ts64(&ts);
+			time = (uint) (ts.tv_sec & 0xffffffff);
+
+#endif
 
 			dgrp_encode_u4(buf + 0, time);
 			dgrp_encode_u2(buf + 4, 0);
 			buf += 6;