diff src/define.h @ 200:d360f96f71f6

start changes for parallel readpst on multi-processor machines
author Carl Byington <carl@five-ten-sg.com>
date Wed, 13 May 2009 20:06:53 -0700
parents ac6e22c8a9cf
children 3850a3b11745
line wrap: on
line diff
--- a/src/define.h	Wed May 13 11:59:55 2009 -0700
+++ b/src/define.h	Wed May 13 20:06:53 2009 -0700
@@ -136,10 +136,18 @@
     #include <sys/types.h>
 #endif
 
+#ifdef HAVE_SYS_WAIT_H
+    #include <sys/wait.h>
+#endif
+
 #ifdef HAVE_DIRENT_H
     #include <dirent.h>
 #endif
 
+#ifdef HAVE_SEMAPHORE_H
+    #include <semaphore.h>
+#endif
+
 
 void  pst_debug(const char *fmt, ...);
 void  pst_debug_hexdumper(FILE* out, char* buf, size_t size, int col, int delta);
@@ -158,14 +166,16 @@
 
 #define LOGSTOP() {MESSAGESTOP();DEBUGSTOP();}
 
-#define DIE(x) {\
- MESSAGEPRINT(x, 0);\
- printf x;\
- exit(EXIT_FAILURE);\
+#define DIE(x) {            \
+    MESSAGEPRINT(x, 0);     \
+    printf x;               \
+    fflush(stdout);         \
+    exit(EXIT_FAILURE);     \
 }
-#define WARN(x) {\
- MESSAGEPRINT(x, 0);\
- printf x;\
+#define WARN(x) {           \
+    MESSAGEPRINT(x, 0);     \
+    printf x;               \
+    fflush(stdout);         \
 }
 
 #ifdef DEBUGPRINT