We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81b7b1e commit 2b9b9e7Copy full SHA for 2b9b9e7
util/oslib-posix.c
@@ -60,6 +60,10 @@
60
#include <mach-o/dyld.h>
61
#endif
62
63
+#ifdef __HAIKU__
64
+#include <kernel/image.h>
65
+#endif
66
+
67
#include "qemu/mmap-alloc.h"
68
69
#ifdef CONFIG_DEBUG_STACK_USAGE
@@ -389,6 +393,21 @@ void qemu_init_exec_dir(const char *argv0)
389
393
}
390
394
391
395
396
+#elif defined(__HAIKU__)
397
+ {
398
+ image_info ii;
399
+ int32_t c = 0;
400
401
+ *buf = '\0';
402
+ while (get_next_image_info(0, &c, &ii) == B_OK) {
403
+ if (ii.type == B_APP_IMAGE) {
404
+ strncpy(buf, ii.name, sizeof(buf));
405
+ buf[sizeof(buf) - 1] = 0;
406
+ p = buf;
407
+ break;
408
+ }
409
410
392
411
412
/* If we don't have any way of figuring out the actual executable
413
location then try argv[0]. */
0 commit comments