summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-02-03 21:59:45 +0000
committerbde <bde@FreeBSD.org>1995-02-03 21:59:45 +0000
commit479b8b6181dfd0dea3f5c939d81a377e2c0966e7 (patch)
tree4c2ea41b1181d769ef21b34902f788b14e23b47d
parent5859d904d15b5f795f49a6574ebb9bc01bfcf913 (diff)
downloadFreeBSD-src-479b8b6181dfd0dea3f5c939d81a377e2c0966e7.zip
FreeBSD-src-479b8b6181dfd0dea3f5c939d81a377e2c0966e7.tar.gz
Change CLK_TCK to CLOCKS_PER_SEC. (CLK_TCK is a deprecated POSIX feature
and is not necessarily related to the ANSI CLOCKS_PER_SEC). Parenthesize macro args.
-rw-r--r--lib/libc/gen/clock.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/gen/clock.c b/lib/libc/gen/clock.c
index 12dc866..fe867c2 100644
--- a/lib/libc/gen/clock.c
+++ b/lib/libc/gen/clock.c
@@ -40,10 +40,11 @@ static char sccsid[] = "@(#)clock.c 8.1 (Berkeley) 6/4/93";
#include <sys/resource.h>
/*
- * Convert usec to clock ticks; could do (usec * CLK_TCK) / 1000000,
+ * Convert usec to clock ticks; could do (usec * CLOCKS_PER_SEC) / 1000000,
* but this would overflow if we switch to nanosec.
*/
-#define CONVTCK(r) (r.tv_sec * CLK_TCK + r.tv_usec / (1000000 / CLK_TCK))
+#define CONVTCK(r) ((r).tv_sec * CLOCKS_PER_SEC \
+ + (r).tv_usec / (1000000 / CLOCKS_PER_SEC))
clock_t
clock()
OpenPOWER on IntegriCloud