Hi,

here a little path for illumos/solaris.

cheers.

regards.
From 5b175adfa5ef9ab52ce69f7eb6775efe8a828974 Mon Sep 17 00:00:00 2001
From: David Carlier <devne...@gmail.com>
Date: Fri, 13 May 2022 20:16:15 +0100
Subject: [PATCH] BUILD/MINOR: few solaris updates.

- get_exec_path using getexecname, fetching AT_SUN_EXECNAME from the
  auxiliary vectors.
- __maybe_unused already defined.
---
 include/haproxy/compiler.h | 2 ++
 src/tools.c                | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/include/haproxy/compiler.h b/include/haproxy/compiler.h
index 49356daab..a935ac3b5 100644
--- a/include/haproxy/compiler.h
+++ b/include/haproxy/compiler.h
@@ -58,10 +58,12 @@
 #endif
 #endif
 
+#ifndef __maybe_unused
 /* silence the "unused" warnings without having to place painful #ifdefs.
  * For use with variables or functions.
  */
 #define __maybe_unused __attribute__((unused))
+#endif
 
 /* These macros are used to declare a section name for a variable.
  * WARNING: keep section names short, as MacOS limits them to 16 characters.
diff --git a/src/tools.c b/src/tools.c
index ed3c3a667..c6bc81be9 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -4821,6 +4821,8 @@ const char *get_exec_path()
 			break;
 		}
 	}
+#elif defined(__sun)
+	ret = getexecname();
 #endif
 	return ret;
 }
-- 
2.36.0

Reply via email to