#ifndef _LINUX_TIMEKEEPING_H
 #define _LINUX_TIMEKEEPING_H
 
+#include <asm-generic/errno-base.h>
+
 /* Included from linux/ktime.h */
 
 void timekeeping_init(void);
  */
 extern void do_gettimeofday(struct timeval *tv);
 extern int do_settimeofday64(const struct timespec64 *ts);
-extern int do_sys_settimeofday(const struct timespec *tv,
-                              const struct timezone *tz);
+extern int do_sys_settimeofday64(const struct timespec64 *tv,
+                                const struct timezone *tz);
+static inline int do_sys_settimeofday(const struct timespec *tv,
+                                     const struct timezone *tz)
+{
+       struct timespec64 ts64;
+
+       if (!tv)
+               return -EINVAL;
+
+       ts64 = timespec_to_timespec64(*tv);
+       return do_sys_settimeofday64(&ts64, tz);
+}
 
 /*
  * Kernel time accessors
 
  * various programs will get confused when the clock gets warped.
  */
 
-int do_sys_settimeofday(const struct timespec *tv, const struct timezone *tz)
+int do_sys_settimeofday64(const struct timespec64 *tv, const struct timezone *tz)
 {
        static int firsttime = 1;
        int error = 0;
 
-       if (tv && !timespec_valid(tv))
+       if (tv && !timespec64_valid(tv))
                return -EINVAL;
 
-       error = security_settime(tv, tz);
+       error = security_settime64(tv, tz);
        if (error)
                return error;
 
                }
        }
        if (tv)
-               return do_settimeofday(tv);
+               return do_settimeofday64(tv);
        return 0;
 }