diff gtk4/dw.c @ 2859:b5cd3242b5e7

Solaris: Add platform specific executable path detection.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 15 Nov 2022 21:41:01 +0000
parents ecfbc48e933a
children 9daee9d58956
line wrap: on
line diff
--- a/gtk4/dw.c	Tue Nov 15 10:32:42 2022 +0000
+++ b/gtk4/dw.c	Tue Nov 15 21:41:01 2022 +0000
@@ -1519,6 +1519,12 @@
    size_t length = PATH_MAX;
 
    if(sysctl(name, 4, path, &length, NULL, 0) == -1 || length <= 1)
+#elif defined(__sun__)
+   char procpath[101] = {0};
+
+   snprintf(procpath, 100, "/proc/%d/path/a.out", getpid());
+
+   if(readlink(procpath, path, PATH_MAX) == -1)
 #endif
       strncpy(path, arg ? arg : "", PATH_MAX);