Browse code

fifo_server made robust

Jiri Kuthan authored on 03/09/2002 10:25:12
Showing 1 changed files
... ...
@@ -7,6 +7,12 @@
7 7
 #ifndef ut_h
8 8
 #define ut_h
9 9
 
10
+
11
+#include <sys/types.h>
12
+#include <sys/time.h>
13
+#include <unistd.h>
14
+
15
+
10 16
 #include "dprint.h"
11 17
 
12 18
 
... ...
@@ -227,4 +233,12 @@ inline static int string2hex(
227 227
 	return orig_len-len;
228 228
 }
229 229
 
230
+inline static void sleep_us( unsigned int nusecs )
231
+{
232
+	struct timeval tval;
233
+	tval.tv_sec=nusecs/100000;
234
+	tval.tv_usec=nusecs%1000000;
235
+	select(0, NULL, NULL, NULL, &tval );
236
+}
237
+
230 238
 #endif