#include <config.h>
-#include "socktools.h"
+#include "support/socktools.h"
+#include "support/lyxlib.h"
+
#include "debug.h"
-#include "lyxlib.h"
#include <sys/socket.h>
#include <sys/un.h>
#include <fcntl.h>
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#include <cerrno>
using std::endl;
-using std::strerror;
-
using std::string;
+#ifndef CXX_GLOBAL_CSTD
+using std::strerror;
+#endif
+
// This MACRO eppears to be defined only on Linux.
#if !defined(SUN_LEN)
#define SUN_LEN(su) \