From d87d2f006c5dac9efb988a7fda9ff4ebd6fe0655 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 27 Apr 2021 19:42:47 +0100 Subject: [PATCH] opcache: more reliable way to get the current binary on solaris/illumos Closes GH-6920. --- ext/opcache/jit/zend_elf.c | 3 +-- ext/opcache/jit/zend_jit_perf_dump.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ext/opcache/jit/zend_elf.c b/ext/opcache/jit/zend_elf.c index ce44b5208b3..a08266dabad 100644 --- a/ext/opcache/jit/zend_elf.c +++ b/ext/opcache/jit/zend_elf.c @@ -64,8 +64,7 @@ void zend_elf_load_symbols(void) } int fd = open(path, O_RDONLY); #elif defined(__sun) - const char *path = getexecname(); - int fd = open(path, O_RDONLY); + int fd = open("/proc/self/path/a.out", O_RDONLY); #elif defined(__HAIKU__) char path[PATH_MAX]; if (find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH, diff --git a/ext/opcache/jit/zend_jit_perf_dump.c b/ext/opcache/jit/zend_jit_perf_dump.c index 8555be2b80e..a7ecfb818aa 100644 --- a/ext/opcache/jit/zend_jit_perf_dump.c +++ b/ext/opcache/jit/zend_jit_perf_dump.c @@ -136,8 +136,7 @@ static void zend_jit_perf_jitdump_open(void) } fd = open(path, O_RDONLY); #elif defined(__sun) - const char *path = getexecname(); - fd = open(path, O_RDONLY); + fd = open("/proc/self/path/a.out", O_RDONLY); #elif defined(__HAIKU__) char path[PATH_MAX]; if (find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH,