Index: imap/promstatsd.c
--- imap/promstatsd.c.orig
+++ imap/promstatsd.c
@@ -5,6 +5,7 @@
 #include <config.h>
 
 #include <sys/types.h>
+#include <sys/time.h>
 
 #include <dirent.h>
 #include <errno.h>
@@ -874,10 +875,24 @@ int main(int argc, char **argv)
 
         wake.tv_sec = next_report_time / 1000;
         wake.tv_nsec = (next_report_time % 1000) * 1000000; /* ms -> ns */
+#ifdef HAVE_CLOCK_NANOSLEEP
         do {
             r = clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &wake, NULL);
             assert(r == 0 || r == EINTR);
         } while (r == EINTR);
+#else
+        /* No clock_nanosleep(2): sleep whatever is left of the interval */
+        for (;;) {
+            struct timespec now, left;
+
+            r = clock_gettime(CLOCK_REALTIME, &now);
+            assert(r == 0);
+            timespecsub(&wake, &now, &left);
+            if (left.tv_sec < 0) break;
+            if (nanosleep(&left, NULL) == 0) break;
+            assert(errno == EINTR);
+        }
+#endif
     }
 
     /* NOTREACHED */
