]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - time/clocktest.c
y2038: Export __clock_gettime64 to be usable in other libraries
[thirdparty/glibc.git] / time / clocktest.c
index cd5fd51aa63e057b1249096b370ce3ba5d261723..779c05d8d95a14fcb074ba8810fbf90b26cf1229 100644 (file)
@@ -3,10 +3,11 @@
 #include <stdlib.h>
 #include <time.h>
 #include <unistd.h>
+#include <stdint.h>
 
 volatile int gotit = 0;
 
-void
+static void
 alarm_handler (int signal)
 {
     gotit = 1;
@@ -28,9 +29,9 @@ main (int argc, char ** argv)
   while (!gotit);
   stop = clock ();
 
-  printf ("%ld clock ticks per second (start=%ld,stop=%ld)\n",
-         stop - start, start, stop);
-  printf ("CLOCKS_PER_SEC=%ld, sysconf(_SC_CLK_TCK)=%ld\n",
-         CLOCKS_PER_SEC, sysconf(_SC_CLK_TCK));
+  printf ("%jd clock ticks per second (start=%jd,stop=%jd)\n",
+         (intmax_t) (stop - start), (intmax_t) start, (intmax_t) stop);
+  printf ("CLOCKS_PER_SEC=%jd, sysconf(_SC_CLK_TCK)=%ld\n",
+         (intmax_t) CLOCKS_PER_SEC, sysconf(_SC_CLK_TCK));
   return 0;
 }