diff options
author | NARUSE, Yui <naruse@airemix.jp> | 2021-02-02 22:10:02 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2021-02-02 22:10:02 +0900 |
commit | 852c112a3f6fe4211c5818c2584a1514f46b7d0b (patch) | |
tree | dfef1560394176efa010cff487ba729efb45a185 /addr2line.c | |
parent | 6673b60f3d86e7431a2ae7b4af7249a01d20f71c (diff) |
merge revision(s) 739f929:
NetBSD build update. (#4079)
---
addr2line.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Diffstat (limited to 'addr2line.c')
-rw-r--r-- | addr2line.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/addr2line.c b/addr2line.c index dc4364aaf5..9669427d36 100644 --- a/addr2line.c +++ b/addr2line.c @@ -2101,11 +2101,15 @@ fail: * and returns strlen(binary_filename). * it is NUL terminated. */ -#if defined(__linux__) +#if defined(__linux__) || defined(__NetBSD__) static ssize_t main_exe_path(void) { -# define PROC_SELF_EXE "/proc/self/exe" +# if defined(__linux__) +# define PROC_SELF_EXE "/proc/self/exe" +# elif defined(__NetBSD__) +# define PROC_SELF_EXE "/proc/curproc/exe" +# endif ssize_t len = readlink(PROC_SELF_EXE, binary_filename, PATH_MAX); if (len < 0) return 0; binary_filename[len] = 0; |