Module Name:    src
Committed By:   njoly
Date:           Mon Jul 12 12:01:53 UTC 2010

Modified Files:
        src/sys/compat/linux/common: linux_time.c
        src/sys/compat/linux32/common: linux32_time.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/compat/linux/common/linux_time.c
cvs rdiff -u -r1.34 -r1.35 src/sys/compat/linux32/common/linux32_time.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_time.c
diff -u src/sys/compat/linux/common/linux_time.c:1.33 src/sys/compat/linux/common/linux_time.c:1.34
--- src/sys/compat/linux/common/linux_time.c:1.33	Thu Apr  8 15:59:37 2010
+++ src/sys/compat/linux/common/linux_time.c	Mon Jul 12 12:01:53 2010
@@ -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)

Index: src/sys/compat/linux32/common/linux32_time.c
diff -u src/sys/compat/linux32/common/linux32_time.c:1.34 src/sys/compat/linux32/common/linux32_time.c:1.35
--- src/sys/compat/linux32/common/linux32_time.c:1.34	Wed Jul  7 01:30:36 2010
+++ src/sys/compat/linux32/common/linux32_time.c	Mon Jul 12 12:01:53 2010
@@ -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)

Reply via email to