mirror of
https://git.freebsd.org/ports.git
synced 2025-06-07 13:50:38 -04:00
Reviewed by: swills (mentor) Approved by: swills (mentor) Differential Revision: https://reviews.freebsd.org/D9467
13 lines
486 B
C++
13 lines
486 B
C++
--- src/runtime/oclgrind.cpp.orig 2017-01-22 12:14:21 UTC
|
|
+++ src/runtime/oclgrind.cpp
|
|
@@ -364,6 +364,10 @@ static string getLibDirPath()
|
|
#if defined(__APPLE__)
|
|
uint32_t sz = PATH_MAX;
|
|
if (_NSGetExecutablePath(exepath, &sz))
|
|
+#elif defined(__FreeBSD__)
|
|
+ char temp[PATH_MAX];
|
|
+ snprintf(temp, sizeof(temp), "/proc/%d/file", getpid());
|
|
+ if (readlink(temp, exepath, PATH_MAX) == -1)
|
|
#else // not apple
|
|
if (readlink("/proc/self/exe", exepath, PATH_MAX) == -1)
|
|
#endif
|