memcpy(dst, PICO_DATA_DIR, sizeof PICO_DATA_DIR);
return sizeof(PICO_DATA_DIR) - 1;
#else
- int j, ret = readlink("/proc/self/exe", dst, len - 1);
+ int j, ret = readlink(
+#ifdef __FreeBSD__
+ "/proc/curproc/file",
+#else
+ "/proc/self/exe",
+#endif
+ dst, len - 1);
if (ret < 0) {
perror("readlink");
ret = 0;
#define LIBPICOFE_POSIX_H
/* define POSIX stuff: dirent, scandir, getcwd, mkdir */
-#if defined(__MACH__) || defined(__linux__) || defined(__MINGW32__)
+#if defined(__FreeBSD__) || defined(__MACH__) || defined(__linux__) || defined(__MINGW32__)
#include <dirent.h>
#include <unistd.h>