build Use readlink() for NetBSD
NetBSD does not have HAVE_REALPATH, we need to use readlink() instead.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
diff --git a/compat/compat.c b/compat/compat.c
index d11dbc2..cf0ca87 100644
--- a/compat/compat.c
+++ b/compat/compat.c
@@ -266,6 +266,19 @@
return resolved;
}
+#elif defined (__NetBSD__)
+char *
+realpath(const char *path, char *resolved_path)
+{
+ ssize_t nbytes;
+
+ nbytes = readlink(path, resolved_path, PATH_MAX);
+ if (nbytes == -1) {
+ return NULL;
+ }
+ return resolved_path;
+}
+
#else
#error No realpath() implementation for this platform is available.
#endif