| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: t_clock_gettime.c,v 1.1 2011/10/15 06:42:16 jruoho Exp $ */ | | 1 | /* $NetBSD: t_clock_gettime.c,v 1.2 2017/01/13 20:10:57 christos Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2008 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2008 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Frank Kardel. | | 8 | * by Frank Kardel. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -48,36 +48,37 @@ | | | @@ -48,36 +48,37 @@ |
48 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 48 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
49 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 49 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
50 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 50 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
51 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 51 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
52 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 52 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
53 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 53 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
54 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 54 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
55 | * POSSIBILITY OF SUCH DAMAGE. | | 55 | * POSSIBILITY OF SUCH DAMAGE. |
56 | */ | | 56 | */ |
57 | | | 57 | |
58 | #include <sys/cdefs.h> | | 58 | #include <sys/cdefs.h> |
59 | __COPYRIGHT("@(#) Copyright (c) 2008\ | | 59 | __COPYRIGHT("@(#) Copyright (c) 2008\ |
60 | The NetBSD Foundation, inc. All rights reserved."); | | 60 | The NetBSD Foundation, inc. All rights reserved."); |
61 | __RCSID("$NetBSD: t_clock_gettime.c,v 1.1 2011/10/15 06:42:16 jruoho Exp $"); | | 61 | __RCSID("$NetBSD: t_clock_gettime.c,v 1.2 2017/01/13 20:10:57 christos Exp $"); |
62 | | | 62 | |
63 | #include <sys/param.h> | | 63 | #include <sys/param.h> |
64 | #include <sys/sysctl.h> | | 64 | #include <sys/sysctl.h> |
65 | | | 65 | |
66 | #include <machine/int_limits.h> | | | |
67 | | | 66 | |
68 | #include <atf-c.h> | | 67 | #include <atf-c.h> |
69 | #include <errno.h> | | 68 | #include <errno.h> |
| | | 69 | #include <limits.h> |
70 | #include <stdio.h> | | 70 | #include <stdio.h> |
| | | 71 | #include <stdint.h> |
71 | #include <stdlib.h> | | 72 | #include <stdlib.h> |
72 | #include <string.h> | | 73 | #include <string.h> |
73 | #include <time.h> | | 74 | #include <time.h> |
74 | #include <unistd.h> | | 75 | #include <unistd.h> |
75 | | | 76 | |
76 | #include "../../../h_macros.h" | | 77 | #include "../../../h_macros.h" |
77 | | | 78 | |
78 | #define MINPOSDIFF 15000000 /* 15 ms for now */ | | 79 | #define MINPOSDIFF 15000000 /* 15 ms for now */ |
79 | #define TIMEOUT 5 | | 80 | #define TIMEOUT 5 |
80 | | | 81 | |
81 | #define TC_HARDWARE "kern.timecounter.hardware" | | 82 | #define TC_HARDWARE "kern.timecounter.hardware" |
82 | #define TC_CHOICE "kern.timecounter.choice" | | 83 | #define TC_CHOICE "kern.timecounter.choice" |
83 | | | 84 | |