File tree Expand file tree Collapse file tree 2 files changed +10
-24
lines changed Expand file tree Collapse file tree 2 files changed +10
-24
lines changed Original file line number Diff line number Diff line change 22
22
#if defined(__FreeBSD__ )
23
23
#include <sys/sysctl.h>
24
24
#elif defined(__HAIKU__ )
25
- #include <kernel/image .h>
25
+ #include <FindDirectory .h>
26
26
#endif
27
27
#include <fcntl.h>
28
28
#include <unistd.h>
@@ -67,20 +67,13 @@ void zend_elf_load_symbols(void)
67
67
const char * path = getexecname ();
68
68
int fd = open (path , O_RDONLY );
69
69
#elif defined(__HAIKU__ )
70
- image_info ii ;
71
- int32_t ic = 0 ;
72
-
73
- while (get_next_image_info (0 , & ic , & ii ) == B_OK ) {
74
- if (ii .type == B_APP_IMAGE ) {
75
- break ;
76
- }
77
- }
78
-
79
- if (ii .type != B_APP_IMAGE ) {
70
+ char path [PATH_MAX ];
71
+ if (find_path (B_APP_IMAGE_SYMBOL , B_FIND_PATH_IMAGE_PATH ,
72
+ NULL , path , sizeof (path )) != B_OK ) {
80
73
return ;
81
74
}
82
75
83
- int fd = open (ii . name , O_RDONLY );
76
+ int fd = open (path , O_RDONLY );
84
77
#else
85
78
// To complete eventually for other ELF platforms.
86
79
// Otherwise APPLE is Mach-O
Original file line number Diff line number Diff line change 36
36
// avoiding thread.h inclusion as it conflicts with vtunes types.
37
37
extern unsigned int thr_self (void );
38
38
#elif defined(__HAIKU__ )
39
- #include <kernel/image .h>
39
+ #include <FindDirectory .h>
40
40
#endif
41
41
42
42
#include "zend_elf.h"
@@ -136,20 +136,13 @@ static void zend_jit_perf_jitdump_open(void)
136
136
const char * path = getexecname ();
137
137
fd = open (path , O_RDONLY );
138
138
#elif defined(__HAIKU__ )
139
- image_info ii ;
140
- int32_t ic = 0 ;
141
-
142
- while (get_next_image_info (0 , & ic , & ii ) == B_OK ) {
143
- if (ii .type == B_APP_IMAGE ) {
144
- break ;
145
- }
146
- }
147
-
148
- if (ii .type != B_APP_IMAGE ) {
139
+ char path [PATH_MAX ];
140
+ if (find_path (B_APP_IMAGE_SYMBOL , B_FIND_PATH_IMAGE_PATH ,
141
+ NULL , path , sizeof (path )) != B_OK ) {
149
142
return ;
150
143
}
151
144
152
- fd = open (ii . name , O_RDONLY );
145
+ fd = open (path , O_RDONLY );
153
146
#else
154
147
fd = -1 ;
155
148
#endif
You can’t perform that action at this time.
0 commit comments