Proper check and dropin replacement for usleep().
[oweals/tinc.git] / lib / dropin.c
index 89039da34c024b6427d110cfea15ccee3c08acf9..1bad05cd43e6fee4c88937f0a69577741819aca6 100644 (file)
@@ -163,3 +163,11 @@ int gettimeofday(struct timeval *tv, void *tz) {
        return 0;
 }
 #endif
+
+#ifndef HAVE_USLEEP
+int usleep(long usec) {
+       struct timeval tv = {usec / 1000000, (usec / 1000) % 1000};
+       select(0, NULL, NULL, NULL, &tv);
+       return 0;
+}
+#endif