*
*/
+#include "include/compat.h"
#include "common/Thread.h"
#include "common/code_environment.h"
#include "common/debug.h"
#include <errno.h>
#include <iostream>
#include <pthread.h>
+
#include <signal.h>
#include <sstream>
#include <stdlib.h>
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
+#include "include/compat.h"
#include "CrushLocation.h"
#include "CrushWrapper.h"
#include "common/config.h"
#define CEPH_COMPAT_H
#if defined(__FreeBSD__)
+
+/* Make sure that ENODATA is defined in the correct way */
+#ifndef ENODATA
#define ENODATA ENOATTR
+#else
+#if (ENODATA == 9919)
+// #warning ENODATA already defined to be 9919, redefining to fix
+// Silencing this warning because it fires at all files where compat.h
+// is included after boost files.
+//
+// This value stems from the definition in the boost library
+// And when this case occurs it is due to the fact that boost files
+// are included before this file. Redefinition might not help in this
+// case since already parsed code has evaluated to the wrong value.
+// This would warrrant for d definition that would actually be evaluated
+// at the location of usage and report a possible confict.
+// This is left up to a future improvement
+#elif (ENODATA != 87)
+#warning ENODATA already defined to a value different from 87 (ENOATRR), refining to fix
+#endif
+#undef ENODATA
+#define ENODATA ENOATTR
+#endif
+
+#ifndef MSG_MORE
#define MSG_MORE 0
+#endif
+
+#ifndef O_DSYNC
+#define O_DSYNC O_SYNC
+#endif
+
+#ifndef HOST_NAME_MAX
+#define HOST_NAME_MAX 64
+#endif
+
+// Fix clock accuracy
+#if !defined(CLOCK_MONOTONIC_COARSE)
+#if defined(CLOCK_MONOTONIC_FAST)
+#define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST
+#else
+#define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC
+#endif
+#endif
+
+/* Fix a small name diff */
+#define pthread_setname_np pthread_set_name_np
+/* And include the extra required include file */
+#include <pthread_np.h>
+
#endif /* !__FreeBSD__ */
#if defined(__APPLE__)
* Foundation. See file COPYING.
*
*/
+#include "include/compat.h"
#include "include/int_types.h"
#include <unistd.h>
#include <iostream>
#include <map>
-#include "include/compat.h"
#include "include/linux_fiemap.h"
#include "common/xattr.h"
*
*/
+#include "include/compat.h"
#include "common/errno.h"
#include "include/atomic.h"
#include "systest_runnable.h"
#include <unistd.h>
#include <vector>
-#if defined(__FreeBSD__)
-#include <pthread_np.h>
-#endif
-
using std::ostringstream;
using std::string;