+void
+snooze(struct timespec *t)
+{
+ struct timespec remainder;
+ int result;
+
+ result = nanosleep(t, &remainder);
+
+ if (result < 0) {
+ if (errno == EINTR) {
+ info(
+ "nanosleep interrupted. Remainder: "
+ "{ tv_sec = %ld, tv_nsec = %ld }",
+ remainder.tv_sec, remainder.tv_nsec);
+ /* No big deal if we occasionally sleep less,
+ * so not attempting to correct after an interruption.
+ */
+ } else {
+ fatal("nanosleep: %s\n", strerror(errno));
+ }
+ }
+}
+