Skip to content

Commit d87d2f0

Browse files
devnexennikic
authored andcommitted
opcache: more reliable way to get the current binary on solaris/illumos
Closes GH-6920.
1 parent dd3e56b commit d87d2f0

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

ext/opcache/jit/zend_elf.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ void zend_elf_load_symbols(void)
6464
}
6565
int fd = open(path, O_RDONLY);
6666
#elif defined(__sun)
67-
const char *path = getexecname();
68-
int fd = open(path, O_RDONLY);
67+
int fd = open("/proc/self/path/a.out", O_RDONLY);
6968
#elif defined(__HAIKU__)
7069
char path[PATH_MAX];
7170
if (find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH,

ext/opcache/jit/zend_jit_perf_dump.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ static void zend_jit_perf_jitdump_open(void)
136136
}
137137
fd = open(path, O_RDONLY);
138138
#elif defined(__sun)
139-
const char *path = getexecname();
140-
fd = open(path, O_RDONLY);
139+
fd = open("/proc/self/path/a.out", O_RDONLY);
141140
#elif defined(__HAIKU__)
142141
char path[PATH_MAX];
143142
if (find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH,

0 commit comments

Comments
 (0)