]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include/compat.h: define EREMOTEIO for FreeBSD
authorWillem Jan Withagen <wjw@digiware.nl>
Thu, 5 Jan 2017 11:14:33 +0000 (12:14 +0100)
committerWillem Jan Withagen <wjw@digiware.nl>
Thu, 12 Jan 2017 15:12:41 +0000 (16:12 +0100)
 - and combined some FreeBSD defines with Apple's

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
src/include/compat.h

index b0ea3b98c85aaf89f1fc9fca662d88e9b74f9221..ecd8a61fe3eafd2ad41e4400ab653f8b1fbb44af 100644 (file)
@@ -38,7 +38,6 @@
 #undef ENODATA
 #define ENODATA ENOATTR
 #endif
-
 #ifndef MSG_MORE
 #define        MSG_MORE 0
 #endif
 #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)
 
 #endif /* !__FreeBSD__ */
 
-#if defined(__APPLE__)
-/* PATH_MAX */
+#if defined(__APPLE__) || defined(__FreeBSD__)
+/* get PATH_MAX */
 #include <limits.h>
+
+#ifndef EREMOTEIO
 #define EREMOTEIO 121
+#endif
+
+#ifndef HOST_NAME_MAX
+#ifdef MAXHOSTNAMELEN 
+#define HOST_NAME_MAX MAXHOSTNAMELEN 
+#else
 #define HOST_NAME_MAX 255
+#endif
+#endif
+
 #endif /* __APPLE__ */
 
 /* O_LARGEFILE is not defined/required on OSX/FreeBSD */