]> sjero.net Git - wget/blobdiff - src/mswindows.c
[svn] Windows fixes by Herold Heiko.
[wget] / src / mswindows.c
index 178b923119709433d09534e65ef4a2b75637aa4a..6353cc280b48f18d2acad96c190aba9189554ccd 100644 (file)
@@ -42,12 +42,29 @@ static int windows_nt_p;
 
 
 /* Emulation of Unix sleep.  */
+
 unsigned int
 sleep (unsigned seconds)
 {
   return SleepEx (1000 * seconds, TRUE) ? 0U : 1000 * seconds;
 }
 
+/* Emulation of Unix usleep().  This has a granularity of
+   milliseconds, but that's ok because:
+
+   a) Wget is only using it with milliseconds;
+
+   b) You can't rely on usleep's granularity anyway.  If a caller
+   expects usleep to respect every microsecond, he's in for a
+   surprise.  */
+
+int
+usleep (unsigned long usec)
+{
+  SleepEx (usec / 1000, TRUE);
+  return 0;
+}
+
 static char *
 read_registry (HKEY hkey, char *subkey, char *valuename, char *buf, int *len)
 {