diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-08-07 03:21:54 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-08-07 03:23:32 +0200 |
commit | 78e1baac0654aad82b855f8ded90c1f35c81a552 (patch) | |
tree | c496fb2da1a38c09e39f4842cc616364a96cc116 /src | |
parent | 5ca89b31210b249f79a1a5cd1a258c85fdb7970e (diff) | |
download | fastd-78e1baac0654aad82b855f8ded90c1f35c81a552.tar fastd-78e1baac0654aad82b855f8ded90c1f35c81a552.zip |
Implement get_current_dir_name() for *BSD systems
Diffstat (limited to 'src')
-rw-r--r-- | src/compat.h | 16 |
1 files changed, 16 insertions, 0 deletions
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 <config.h> #include <stdint.h> +#include <unistd.h> #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_ */ |