summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-07-28 21:15:17 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-07-29 13:58:38 +0200
commitce401448d62f65956ed57b077af2b315f59efe94 (patch)
treeafcfd1cb6399811f2275a7ebfc345f8e3f3afd27 /include
parent2d529f912c089033e2f40fd0978ccb741bfe2bbb (diff)
downloadouroboros-ce401448d62f65956ed57b077af2b315f59efe94.tar.gz
ouroboros-ce401448d62f65956ed57b077af2b315f59efe94.zip
lib: Portability to FreeBSD
Various portability fixes for FreeBSD. POSIX requires shm file names to start with a "/" to be portable. lseek(2) can be undefined on POSIX shm, replaced with ftruncate(2). IRMd check on existing lockfile more portable. FreeBSD 11.0 is preferred as it natively supports robust mutexes. Full working LLC implementation pending.
Diffstat (limited to 'include')
-rw-r--r--include/ouroboros/config.h.in10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/ouroboros/config.h.in b/include/ouroboros/config.h.in
index 7bb4cee0..3a6dd3c8 100644
--- a/include/ouroboros/config.h.in
+++ b/include/ouroboros/config.h.in
@@ -27,6 +27,10 @@
#define PROJECT_VERSION "@PACKAGE_VERSION@"
#define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
#define _POSIX_C_SOURCE 200809L
+#define __XSI_VISIBLE 500
+#ifdef __FreeBSD__
+#define __BSD_VISIBLE 1
+#endif
#define IPCP_SHIM_UDP_EXEC "@IPCP_SHIM_UDP_TARGET@"
#define IPCP_SHIM_ETH_LLC_EXEC "@IPCP_SHIM_ETH_LLC_TARGET@"
#define IPCP_NORMAL_EXEC "@IPCP_NORMAL_TARGET@"
@@ -34,13 +38,13 @@
#define AP_MAX_FLOWS 256
#define SHM_DU_BUFF_BLOCK_SIZE sysconf(_SC_PAGESIZE)
#define SHM_DU_MAP_MULTI_BLOCK
-#define SHM_DU_MAP_FILENAME "ouroboros.shm"
-#define LOCKFILE_NAME "ouroboros.lockfile"
+#define SHM_DU_MAP_FILENAME "/ouroboros.shm"
+#define LOCKFILE_NAME "/ouroboros.lockfile"
#define SHM_BLOCKS_IN_MAP (1 << 14)
#define SHM_DU_TIMEOUT_MICROS 15000
#define DU_BUFF_HEADSPACE 128
#define DU_BUFF_TAILSPACE 0
-#define SHM_AP_RBUFF_PREFIX "ouroboros.rbuff."
+#define SHM_AP_RBUFF_PREFIX "/ouroboros.rbuff."
#define SHM_RBUFF_SIZE (1 << 14)
#define IRMD_MAX_FLOWS 4096
#define IRMD_THREADPOOL_SIZE 3