[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sbcl-commits
Subject:    [Sbcl-commits] master: Haiku: implement os_get_runtime_executable_path.
From:       stassats via Sbcl-commits <sbcl-commits () lists ! sourceforge ! net>
Date:       2019-09-23 11:49:30
Message-ID: 1569239370.911966.20942 () sfp-scm-6 ! v30 ! lw ! sourceforge ! com
[Download RAW message or body]

The branch "master" has been updated in SBCL:
       via  84dade0b1d738c05191c07e1a73dbf2075f7f0cb (commit)
      from  f36fe4433bf5a83923e20974c86b02c639cc1a1c (commit)

- Log -----------------------------------------------------------------
commit 84dade0b1d738c05191c07e1a73dbf2075f7f0cb
Author: Stas Boukarev <stassats@gmail.com>
Date:   Mon Sep 23 14:48:57 2019 +0300

    Haiku: implement os_get_runtime_executable_path.
    
    Patch by Alexandru Popa.
---
 src/runtime/haiku-os.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/runtime/haiku-os.c b/src/runtime/haiku-os.c
index 207d78525..14f222498 100644
--- a/src/runtime/haiku-os.c
+++ b/src/runtime/haiku-os.c
@@ -3,6 +3,7 @@
 #include "interrupt.h"
 #include "arch.h" // for arch_get_bad_addr
 #include "interrupt.h" // for sig_stop_for_gc_handler
+#include <image.h>
 #include <stdio.h>
 
 size_t os_vm_page_size;
@@ -53,7 +54,13 @@ os_protect(os_vm_address_t address, os_vm_size_t length, os_vm_prot_t prot)
 
 char *os_get_runtime_executable_path(int __attribute__((unused)) external)
 {
-    return NULL; // this function is allowed to fail
+    int cookie = 0;
+    image_info info;
+    int status = _get_next_image_info(0, &cookie, &info, sizeof(info));
+    if (status == 0)
+        return info.name;
+    else
+        return NULL;
 }
 
 void

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL


_______________________________________________
Sbcl-commits mailing list
Sbcl-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic