Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: better support for BSDs for $ZSH_EXEPATH
- X-seq: zsh-workers 53092
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: better support for BSDs for $ZSH_EXEPATH
- Date: Mon, 16 Sep 2024 00:50:33 +0200
- Archived-at: <https://zsh.org/workers/53092>
- In-reply-to: <11850-1726268365.698506@T5TA.elFs._Yg_>
- List-id: <zsh-workers.zsh.org>
- References: <11850-1726268365.698506@T5TA.elFs._Yg_>
I wrote:
> To implement $ZSH_EXEPATH there is Mac and Linux specific solutions
> followed by a fallback using argv[0] and a $PATH search. This adds a
> better approach for NetBSD, FreeBSD and DragonflyBSD based on sysctl(3).
Apparently on Linux systems of a certain age, sys/sysctl.h exists but
including it prints warnings about use of a deprecated header. On the
newer system I tested against it no longer exists. I can't find a better
way to avoid this warning than the following.
Oliver
diff --git a/Src/init.c b/Src/init.c
index 2f914f96b..61f759ded 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -36,7 +36,7 @@
#include "version.h"
-#ifdef HAVE_SYS_SYSCTL_H
+#if defined(HAVE_SYS_SYSCTL_H) && !defined(__linux)
#include <sys/sysctl.h>
#endif
Messages sorted by:
Reverse Date,
Date,
Thread,
Author