From patchwork Fri Jun 26 14:01:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David CARLIER X-Patchwork-Id: 11627661 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD18C60D for ; Fri, 26 Jun 2020 14:03:12 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A39AD207E8 for ; Fri, 26 Jun 2020 14:03:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZPayi8Mt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A39AD207E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:54430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joowh-0004OR-Tb for patchwork-qemu-devel@patchwork.kernel.org; Fri, 26 Jun 2020 10:03:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joovp-0003NQ-Vk; Fri, 26 Jun 2020 10:02:17 -0400 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]:46165) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1joovk-0003T9-LN; Fri, 26 Jun 2020 10:02:17 -0400 Received: by mail-ed1-x542.google.com with SMTP id dm19so769987edb.13; Fri, 26 Jun 2020 07:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Sk4jPNPZZZQEXgb8aF5QfKzPGN3qP8PnnMdQeGvFFTU=; b=ZPayi8MtEppC+1aB1oPYIXmeYcYcnB9oKV74CIZXTQbrq1o4eRJaRlXBwLFFCY61Jj +7yg557iC1xkUwubFB6ji/btXJR90c3ylSl5lisuC4AXQfBGb6edNIhJE0+k36Sto/KC OKKo3l2S8ZNTFDIi7j9awtAbtha3lvc9rYnD3KB1WUz5hZ1pn4pIuFiRTkxftY5vQCdd 0Cl2KDa3JXHlxHgJeBUOgXR6+Wrojfdg+gNqgtDvnbp778liCoE3cvFw6Ustp0H6Ze3h yQ9Uh9OJLXWC5RGR/SUpcZeAVNBmm/w15TF72PIZ5g0ngWZMvKpu6kENYq01mmgx3eex iTVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Sk4jPNPZZZQEXgb8aF5QfKzPGN3qP8PnnMdQeGvFFTU=; b=JuWt9ekPeBwPgrcVINNO7SnFRxNGLuZIH5t7F97f+4tH0eq866EMNVnkTx2MZppIrv JhKy7pslf5dNAiY8PfoxMMY5h297lqv6/p8WHRqBTIXpk4dGQTz5MK7mtYACtiNTbv7T PBisV+dkNB6rkLeFXp6z9U/5QSoFmi6zMuXr3mMXSaZ/3McYadOrSvWaDnMZyncgS4IN ngJAEGR0wGYJLVNKyqyOscKjNP6XiVjHKVKwC6+hXHxTu1WdNoYRRYTwG9gtFCZBZJLX YihLQSmswhKSMM/6u1yjgLKVHgX+9ttYdI41oMVcEf/CBB/YF80cSmq7blYRqrGfO0tL QHEg== X-Gm-Message-State: AOAM533THMm0ULGCGmvXE+kMIa0fZuhoXhnDqoyllRkfntzAJtEopYtT kdUPyYq3EfS2uf0JjXPGViXRaANkM55zv6RDixdulsRYxPZCDg== X-Google-Smtp-Source: ABdhPJx5FlwKxaqa0AfRsJPr1OaULD567mNbq6Pzs+KwqW7iTimIGlfy4QDOhmpdRyPA62Js4j/3UOttBgLKuMVgps0= X-Received: by 2002:aa7:d792:: with SMTP id s18mr3580645edq.7.1593180125760; Fri, 26 Jun 2020 07:02:05 -0700 (PDT) MIME-Version: 1.0 From: David CARLIER Date: Fri, 26 Jun 2020 15:01:55 +0100 Message-ID: Subject: [PATCH 1/3] : haiku check sys signal.h presence To: QEMU Trivial , qemu-devel Received-SPF: pass client-ip=2a00:1450:4864:20::542; envelope-from=devnexen@gmail.com; helo=mail-ed1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From a4dfa918e6eea7a5ccc4375d83d1f0162e3bb122 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Fri, 26 Jun 2020 13:43:59 +0000 Subject: [PATCH 1/3] check sys/signal.h presence Signed-off-by: David Carlier --- configure | 8 ++++++++ hw/xen/xen-legacy-backend.c | 1 - include/qemu/osdep.h | 2 +- util/oslib-posix.c | 1 - 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/configure b/configure index ba88fd1824..5101fd79fd 100755 --- a/configure +++ b/configure @@ -3181,6 +3181,11 @@ if ! check_include "ifaddrs.h" ; then have_ifaddrs_h=no fi +have_sys_signal_h=no +if check_include "sys/signal.h" ; then + have_sys_signal_h=yes +fi + ########################################## # VTE probe @@ -7286,6 +7291,9 @@ fi if test "$have_broken_size_max" = "yes" ; then echo "HAVE_BROKEN_SIZE_MAX=y" >> $config_host_mak fi +if test "$have_sys_signal_h" = "yes" ; then + echo "CONFIG_SYS_SIGNAL=y" >> $config_host_mak +fi # Work around a system header bug with some kernel/XFS header # versions where they both try to define 'struct fsxattr': diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c index 2335ee2e65..92f08fca29 100644 --- a/hw/xen/xen-legacy-backend.c +++ b/hw/xen/xen-legacy-backend.c @@ -23,7 +23,6 @@ */ #include "qemu/osdep.h" -#include #include "hw/sysbus.h" #include "hw/boards.h" diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index ff7c17b857..f88fe23936 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -104,7 +104,7 @@ extern int daemon(int, int); #include #include -#ifdef __OpenBSD__ +#ifdef CONFIG_SYS_SIGNAL #include #endif diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 39ddc77c85..7ad9195c44 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -38,7 +38,6 @@ #include "qemu/sockets.h" #include "qemu/thread.h" #include -#include #include "qemu/cutils.h" #ifdef CONFIG_LINUX From patchwork Fri Jun 26 14:03:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David CARLIER X-Patchwork-Id: 11627667 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 267B813B4 for ; Fri, 26 Jun 2020 14:05:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F071F20702 for ; Fri, 26 Jun 2020 14:05:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ShYhlJNx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F071F20702 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:60290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jooyh-00079k-7g for patchwork-qemu-devel@patchwork.kernel.org; Fri, 26 Jun 2020 10:05:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joowm-0004X1-EV; Fri, 26 Jun 2020 10:03:16 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:39106) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1joowk-0003xh-TL; Fri, 26 Jun 2020 10:03:16 -0400 Received: by mail-ed1-x52d.google.com with SMTP id d18so1375677edv.6; Fri, 26 Jun 2020 07:03:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=gkoQ7wKEqYIgyzpfrFvA5qo0YC+QngQ6l2mRgEwy8/M=; b=ShYhlJNxBUj5aFljVu9xwGiJ3hi3g0W8gHYqmQUBTwkCI5TW9MptYdd2I6QYqH+ukp zzisTUKZX118MIVP1VjPyOIqwKbJNlu2irkzbqm7jAk3kbo8EHpuWj9NHYEwa+wexvoY +nfYJnyOM2TJi+qAtSxWnc9c+BkmN0s2H8HKcmxokOg/TnpnCprJZO/8gkUG7zv+EGgk CUqTH2CktFeCHIEje1HqFoi8t94w6wJNfGNJaR0yafqiCOrTchdHs7+g/Pn8RN/vwiTt sq20xwH1j6boc6LFRYfV/OnsMP/bqAZblAy3SAHPIJhSQdJVb1CdoWgZBXkD26btix/D 3Asw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=gkoQ7wKEqYIgyzpfrFvA5qo0YC+QngQ6l2mRgEwy8/M=; b=paE17ELw746aRqz0RJdmSWq94n3QStZF4idCV2aGydUJChN3ht/dmesvCH1HcnowOt S2z4hZqVxcEd6iTagbUD9YcsV1RfD2ybvFhovrc5TH0k5gNrP9vp1comoPeq38iDwXlE +xZmgK+7vRYItDtKLM/GjZAigqqdhJlMz48EReX2KDrQY2thLV1MOpL1XvMrDLGOaSX4 VAPk5ekdK38AQL5Cizer1yh0R62B1hEFyb9x72avPnRJGfyLZCjJgcSt6blu0RXoMhQm silxNh/3ixqy9EBhpfJnutKWVIddSB3JVvTPQBjukPpX6ipFApi5wOvueMqpM+aa1PqO QcnQ== X-Gm-Message-State: AOAM532mLi1scFx3JHKMFsKb33/DHJWOJelcGXRIPfVQLshnjpvfMEEa ba2JGjklwNgElTacTB9UpGKsNusq6JBllDu1d1n8JOAn6z1d8g== X-Google-Smtp-Source: ABdhPJwGsdeLQDdnnzCB2xswnyc+30sR/haetUsD2Abfm+DrsHvj3kWvzjpfy5fSIlrji2ksuXa7XdGaKFsv6wgMgM8= X-Received: by 2002:a50:9a82:: with SMTP id p2mr3456498edb.130.1593180193043; Fri, 26 Jun 2020 07:03:13 -0700 (PDT) MIME-Version: 1.0 From: David CARLIER Date: Fri, 26 Jun 2020 15:03:02 +0100 Message-ID: Subject: [PATCH 2/3] define SIGIO for haiku To: QEMU Trivial , qemu-devel Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=devnexen@gmail.com; helo=mail-ed1-x52d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From d36aba6190152c626f668fef3704ee6b61bfc323 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Fri, 26 Jun 2020 13:45:04 +0000 Subject: [PATCH 2/3] define SIGIO for haiku Signed-off-by: David Carlier Reviewed-by: Philippe Mathieu-Daudé --- include/qemu/osdep.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index f88fe23936..860bb3c16c 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -388,6 +388,10 @@ void qemu_anon_ram_free(void *ptr, size_t size); #define HAVE_CHARDEV_PARPORT 1 #endif +#if defined(__HAIKU__) +#define SIGIO SIGPOLL +#endif + #if defined(CONFIG_LINUX) #ifndef BUS_MCEERR_AR #define BUS_MCEERR_AR 4 From patchwork Fri Jun 26 14:03:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David CARLIER X-Patchwork-Id: 11627681 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7629914E3 for ; Fri, 26 Jun 2020 14:06:15 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4CE1A207D8 for ; Fri, 26 Jun 2020 14:06:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Zat6Fl/T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4CE1A207D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jooze-000082-ID for patchwork-qemu-devel@patchwork.kernel.org; Fri, 26 Jun 2020 10:06:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jooxi-000610-2b; Fri, 26 Jun 2020 10:04:14 -0400 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]:45924) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jooxg-0004Oa-ED; Fri, 26 Jun 2020 10:04:13 -0400 Received: by mail-ed1-x541.google.com with SMTP id d16so382337edz.12; Fri, 26 Jun 2020 07:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=XA6nzqvVSiJXdseQ/eelzB9rYtYWuwUACPaHWj97sq4=; b=Zat6Fl/TI+4DSV/Cxfjj3oMu5Kzn+P5tnqLFexKsqd3B6D9jMFA4zHodLgOfu294VK TzylrYLx/+Jsc12OUnmGEQcxtqzBspgzAI8EW+XlZ0ou4ImC+hh97ywJwJscOXLOqgK+ FDCG8tZgUI/kS8yvKKVw+CzMzM84rxvva3VIPwgyck1Zj57TRZF1Q4tgE8CPLa32DaKK eyovMpv5gH32NQ2aRCjDXgCo4hI9t1sUPhALVVh5MLQao5OC6Tt0/Y2FD5UxzP+MbPgT HcZdG9UZbuQs4dKFjazaNPOY8rsUj3Kk10q62hY4Qx6ToES8egwcoTlXI7X2MIL1yWTj nRvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=XA6nzqvVSiJXdseQ/eelzB9rYtYWuwUACPaHWj97sq4=; b=R52Rg+v2Y2e2XajpeUybirZw62k4uG8b6E5G1EhPqs6bnECs0xFdAiFt63vjzRueG+ BqO/FkKkPG26dLrc2QFb9MBcEEAJXM2boDqI2wz15VhsVzdOA3jbcqIBdCWUqiHydHJW xwkdEg3i+8UcqsWK9GsS5Mjaevbsm3JII8T7eXG/O44hjhHtal2Ghl+cjRW9a6nrfOkb zLBcV4t1/sUkq6tIt7hQ45nBhQRNTT3x7jDtvEY/o8kVk/RtsiPOS4udFXi9gIV/nx35 /Zf8P4eNHqMFJ3YPMSPNZL5nPnRaipz22OMk14fX1kvoyEBZLbH6F0hD2qiom6vMVpqd csOQ== X-Gm-Message-State: AOAM53018m5dTXIkZLUBpZ4d7/BgSKIpcrkfV0aP6PoLxAva/Vgw6ELI XzzUgDV2ht4ffSYqsT+yjKE+e/77GZpMbYz0rj4Lle7kwsosIA== X-Google-Smtp-Source: ABdhPJzWKvHq/Cl2NaRCRxA4MJm7SQFp/zQXc5xszIFwcqpe6SBj9Hyj3V29e8E4k4vVIiAqc/Km9BEodJul7+G8REA= X-Received: by 2002:a05:6402:354:: with SMTP id r20mr1966454edw.32.1593180250270; Fri, 26 Jun 2020 07:04:10 -0700 (PDT) MIME-Version: 1.0 From: David CARLIER Date: Fri, 26 Jun 2020 15:03:59 +0100 Message-ID: Subject: [PATCH 3/3] qemu_init_exec_dir Haiku implementation To: QEMU Trivial , qemu-devel Received-SPF: pass client-ip=2a00:1450:4864:20::541; envelope-from=devnexen@gmail.com; helo=mail-ed1-x541.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From 6fa7a4108236f513201192654e07c7044a3d7e58 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Fri, 26 Jun 2020 13:51:37 +0000 Subject: [PATCH 3/3] qemu_init_exec_dir Haiku implementation Signed-off-by: David Carlier --- util/oslib-posix.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 7ad9195c44..459e3f8093 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -60,6 +60,10 @@ #include #endif +#ifdef __HAIKU__ +#include +#endif + #include "qemu/mmap-alloc.h" #ifdef CONFIG_DEBUG_STACK_USAGE @@ -389,6 +393,21 @@ void qemu_init_exec_dir(const char *argv0) } } } +#elif defined(__HAIKU__) + { + image_info ii; + int32_t c = 0; + + *buf = '\0'; + while (get_next_image_info(0, &c, &ii) == B_OK) { + if (ii.type == B_APP_IMAGE) { + strncpy(buf, ii.name, sizeof(buf)); + buf[sizeof(buf) - 1] = 0; + p = buf; + break; + } + } + } #endif /* If we don't have any way of figuring out the actual executable location then try argv[0]. */