X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=libpicofe.git;a=blobdiff_plain;f=linux%2Fplat.c;fp=linux%2Fplat.c;h=2cdcace7a2a5a67116cb9d8cbb15942f16b51484;hp=b1c331436d397b02352ee1af825fd6741c463764;hb=740c6f25f8240deeb732a0a999f2a57cc2f6f6d6;hpb=b0ce6fa8bd3c171debd5589f3ee8a95e26b1d61b diff --git a/linux/plat.c b/linux/plat.c index b1c3314..2cdcace 100644 --- a/linux/plat.c +++ b/linux/plat.c @@ -56,7 +56,13 @@ static int plat_get_exe_dir(char *dst, int len) 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;