Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat Add CLOCK_MONOTONIC support for compat linux/linux32



details:   https://anonhg.NetBSD.org/src/rev/b37d41cae10b
branches:  trunk
changeset: 756324:b37d41cae10b
user:      njoly <njoly%NetBSD.org@localhost>
date:      Mon Jul 12 12:01:53 2010 +0000

description:
Add CLOCK_MONOTONIC support for compat linux/linux32
clock_nanosleep(2).

diffstat:

 sys/compat/linux/common/linux_time.c     |  10 ++++++----
 sys/compat/linux32/common/linux32_time.c |  11 +++++++----
 2 files changed, 13 insertions(+), 8 deletions(-)

diffs (70 lines):

diff -r 1340b6af6171 -r b37d41cae10b sys/compat/linux/common/linux_time.c
--- a/sys/compat/linux/common/linux_time.c      Mon Jul 12 11:04:25 2010 +0000
+++ b/sys/compat/linux/common/linux_time.c      Mon Jul 12 12:01:53 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_time.c,v 1.33 2010/04/08 15:59:37 njoly Exp $ */
+/*     $NetBSD: linux_time.c,v 1.34 2010/07/12 12:01:53 njoly Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.33 2010/04/08 15:59:37 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.34 2010/07/12 12:01:53 njoly Exp $");
 
 #include <sys/param.h>
 #include <sys/ucred.h>
@@ -272,12 +272,14 @@
        struct linux_timespec lrqts, lrmts;
        struct timespec rqts, rmts;
        int error, error1;
+       clockid_t nwhich;
 
        if (SCARG(uap, flags) != 0)
                return EINVAL;          /* XXX deal with TIMER_ABSTIME */
 
-       if (SCARG(uap, which) != LINUX_CLOCK_REALTIME)
-               return EINVAL;
+       error = linux_to_native_clockid(&nwhich, SCARG(uap, which));
+       if (error != 0)
+               return error;
 
        error = copyin(SCARG(uap, rqtp), &lrqts, sizeof lrqts);
        if (error != 0)
diff -r 1340b6af6171 -r b37d41cae10b sys/compat/linux32/common/linux32_time.c
--- a/sys/compat/linux32/common/linux32_time.c  Mon Jul 12 11:04:25 2010 +0000
+++ b/sys/compat/linux32/common/linux32_time.c  Mon Jul 12 12:01:53 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux32_time.c,v 1.34 2010/07/07 01:30:36 chs Exp $ */
+/*     $NetBSD: linux32_time.c,v 1.35 2010/07/12 12:01:53 njoly Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: linux32_time.c,v 1.34 2010/07/07 01:30:36 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_time.c,v 1.35 2010/07/12 12:01:53 njoly Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -360,11 +360,14 @@
        struct linux32_timespec lrqts, lrmts;
        struct timespec rqts, rmts;
        int error, error1;
+       clockid_t id;
 
        if (SCARG(uap, flags) != 0)
                return EINVAL;          /* XXX deal with TIMER_ABSTIME */
-       if (SCARG(uap, which) != LINUX_CLOCK_REALTIME)
-               return EINVAL;
+
+       error = linux_to_native_clockid(&id, SCARG(uap, which));
+       if (error != 0)
+               return error;
 
        error = copyin(SCARG_P32(uap, rqtp), &lrqts, sizeof lrqts);
        if (error != 0)



Home | Main Index | Thread Index | Old Index