File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 21
21
#include <sys/stat.h>
22
22
#if defined(__FreeBSD__ )
23
23
#include <sys/sysctl.h>
24
+ #elif defined(__HAIKU__ )
25
+ #include <kernel/image.h>
24
26
#endif
25
27
#include <fcntl.h>
26
28
#include <unistd.h>
@@ -64,6 +66,21 @@ void zend_elf_load_symbols(void)
64
66
#elif defined(__sun )
65
67
const char * path = getexecname ();
66
68
int fd = open (path , O_RDONLY );
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 ) {
80
+ return ;
81
+ }
82
+
83
+ int fd = open (ii .name , O_RDONLY );
67
84
#else
68
85
// To complete eventually for other ELF platforms.
69
86
// Otherwise APPLE is Mach-O
Original file line number Diff line number Diff line change 35
35
#elif defined(__sun )
36
36
// avoiding thread.h inclusion as it conflicts with vtunes types.
37
37
extern unsigned int thr_self (void );
38
+ #elif defined(__HAIKU__ )
39
+ #include <kernel/image.h>
38
40
#endif
39
41
40
42
#include "zend_elf.h"
@@ -133,6 +135,21 @@ static void zend_jit_perf_jitdump_open(void)
133
135
#elif defined(__sun )
134
136
const char * path = getexecname ();
135
137
fd = open (path , O_RDONLY );
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 ) {
149
+ return ;
150
+ }
151
+
152
+ fd = open (ii .name , O_RDONLY );
136
153
#else
137
154
fd = -1 ;
138
155
#endif
You can’t perform that action at this time.
0 commit comments