After the recent patch to allow Linux builds to read /proc/self/exe, I
figured doing the equivalent on Solaris would be pretty easy.  The patch is
attached.

Thanks,
Danek

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/auto/configure b/src/auto/configure
index 73b9ce7..c0570a4 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -10101,12 +10101,17 @@ fi
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /proc/self/exe" >&5
-$as_echo_n "checking for /proc/self/exe... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /proc link to 
executable" >&5
+$as_echo_n "checking for /proc link to executable... " >&6; }
 if test -L "/proc/self/exe"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-    $as_echo "#define HAVE_PROC_SELF_EXE 1" >>confdefs.h
+    $as_echo "#define PROC_EXE_LINK \"/proc/self/exe\"" >>confdefs.h
+
+elif test -L "/proc/self/path/a.out"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: /proc/self/path/a.out" >&5
+$as_echo "/proc/self/path/a.out" >&6; }
+    $as_echo "#define PROC_EXE_LINK \"/proc/self/path/a.out\"" >>confdefs.h
 
 else
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
diff --git a/src/config.h.in b/src/config.h.in
index a9bcf1e..f8a23ed 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -446,8 +446,8 @@
 /* Define if fcntl()'s F_SETFD command knows about FD_CLOEXEC */
 #undef HAVE_FD_CLOEXEC
 
-/* Define if /proc/self/exe can be read */
-#undef HAVE_PROC_SELF_EXE
+/* Define if /proc/self/exe or similar can be read */
+#undef PROC_EXE_LINK
 
 /* Define if you want Cygwin to use the WIN32 clipboard, not compatible with 
X11*/
 #undef FEAT_CYGWIN_WIN32_CLIPBOARD
diff --git a/src/configure.ac b/src/configure.ac
index 4445cf5..23fd88c 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -3020,10 +3020,13 @@ dnl 
---------------------------------------------------------------------------
 dnl end of GUI-checking
 dnl ---------------------------------------------------------------------------
 
-AC_MSG_CHECKING([for /proc/self/exe])
+AC_MSG_CHECKING([for /proc link to executable])
 if test -L "/proc/self/exe"; then
     AC_MSG_RESULT(yes)
-    AC_DEFINE(HAVE_PROC_SELF_EXE)
+    AC_DEFINE(PROC_EXE_LINK, "/proc/self/exe")
+elif test -L "/proc/self/path/a.out"; then
+    AC_MSG_RESULT(/proc/self/path/a.out)
+    AC_DEFINE(PROC_EXE_LINK, "/proc/self/path/a.out")
 else
     AC_MSG_RESULT(no)
 fi
diff --git a/src/main.c b/src/main.c
index aa5a1a2..29ab3c6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3539,11 +3539,11 @@ set_progpath(char_u *argv0)
 {
     char_u *val = argv0;
 
-# ifdef HAVE_PROC_SELF_EXE
+# ifdef PROC_EXE_LINK
     char    buf[PATH_MAX + 1];
     ssize_t len;
 
-    len = readlink("/proc/self/exe", buf, PATH_MAX);
+    len = readlink(PROC_EXE_LINK, buf, PATH_MAX);
     if (len > 0)
     {
        buf[len] = NUL;

Raspunde prin e-mail lui