From e30c27f03c0544e18b161a0aad0bd87c00fc3d85 Mon Sep 17 00:00:00 2001 From: Willem Jan Withagen Date: Thu, 5 Jan 2017 12:14:33 +0100 Subject: [PATCH] include/compat.h: define EREMOTEIO for FreeBSD - and combined some FreeBSD defines with Apple's Signed-off-by: Willem Jan Withagen --- src/include/compat.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/include/compat.h b/src/include/compat.h index b0ea3b98c85aa..ecd8a61fe3eaf 100644 --- a/src/include/compat.h +++ b/src/include/compat.h @@ -38,7 +38,6 @@ #undef ENODATA #define ENODATA ENOATTR #endif - #ifndef MSG_MORE #define MSG_MORE 0 #endif @@ -47,10 +46,6 @@ #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) @@ -72,11 +67,22 @@ #endif /* !__FreeBSD__ */ -#if defined(__APPLE__) -/* PATH_MAX */ +#if defined(__APPLE__) || defined(__FreeBSD__) +/* get PATH_MAX */ #include + +#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 */ -- 2.39.5