8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 160d44a commit 99bb723Copy full SHA for 99bb723
ggml/src/ggml-backend-reg.cpp
@@ -402,12 +402,16 @@ static std::string get_executable_path() {
402
base_path = base_path.substr(0, last_slash);
403
}
404
return base_path + "/";
405
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__FreeBSD__)
406
std::string base_path = ".";
407
std::vector<char> path(1024);
408
while (true) {
409
// get executable path
410
+# if defined(__linux__)
411
ssize_t len = readlink("/proc/self/exe", path.data(), path.size());
412
+# elif defined(__FreeBSD__)
413
+ ssize_t len = readlink("/proc/curproc/file", path.data(), path.size());
414
+# endif
415
if (len == -1) {
416
break;
417
0 commit comments