summaryrefslogtreecommitdiff
path: root/make.h
diff options
context:
space:
mode:
Diffstat (limited to 'make.h')
-rw-r--r--make.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/make.h b/make.h
index 32f233f..2e354c9 100644
--- a/make.h
+++ b/make.h
@@ -537,3 +537,17 @@ extern int handling_fatal_signal;
#ifdef HAVE_DMALLOC_H
#include <dmalloc.h>
#endif
+
+
+/* If we have broken SA_RESTART support, then wrap stat() and readdir() with
+ versions that handle EINTR. Note that there are still plenty of system
+ calls that can fail with EINTR but this, reportedly, gets the vast
+ majority of failure cases. If you still experience failures you'll need
+ to either get a system where SA_RESTART works, or you need to avoid -j. */
+
+#ifdef HAVE_BROKEN_RESTART
+
+#define stat(_f,_b) atomic_stat ((_f), (_b))
+#define readdir(_d) atomic_readdir (_d)
+
+#endif