Update for recent build tools
[mdsms.git] / usleep.c
diff --git a/usleep.c b/usleep.c
new file mode 100644 (file)
index 0000000..ecbd104
--- /dev/null
+++ b/usleep.c
@@ -0,0 +1,27 @@
+#include "config.h"
+#ifndef lint
+static char rcsid[] ATTR_UNUSED = "$Id$";
+#endif
+
+/* This part of code is a public domain */
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+/* CONFORMING TO BSD 4.3 */
+
+void usleep(unsigned long usec)
+{
+struct timeval tv;
+
+  tv.tv_sec =usec/1000000;
+  tv.tv_usec=usec%1000000;
+  select(0,NULL,NULL,NULL,&tv);
+}