Added checks for sys/errno.h, sys/signal.h and sys/mman.h.

diff --git a/misc/registry.c b/misc/registry.c
index f2f1d7d..b58d157 100644
--- a/misc/registry.c
+++ b/misc/registry.c
@@ -24,7 +24,9 @@
 #include <unistd.h>
 #include <ctype.h>
 #include <errno.h>
+#ifdef HAVE_SYS_ERRNO_H
 #include <sys/errno.h>
+#endif
 #include <sys/types.h>
 #include <sys/fcntl.h>
 #include <sys/stat.h>