From 78e1baac0654aad82b855f8ded90c1f35c81a552 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 7 Aug 2013 03:21:54 +0200 Subject: Implement get_current_dir_name() for *BSD systems --- src/compat.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/compat.h') diff --git a/src/compat.h b/src/compat.h index 6afcbad..5a24a97 100644 --- a/src/compat.h +++ b/src/compat.h @@ -30,6 +30,7 @@ #include #include +#include #ifndef ETH_ALEN @@ -48,4 +49,19 @@ struct ethhdr { } __attribute__((packed)); #endif + +#ifndef HAVE_GET_CURRENT_DIR_NAME + +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) +static inline char *get_current_dir_name(void) { + return getcwd(NULL, 0); +} +#else + +#error unknown system, get_current_dir_name() not implemented + +#endif + +#endif + #endif /* _FASTD_COMPAT_H_ */ -- cgit v1.2.3