Check for definition of AT_SECURE before using it
authorStephane Glondu <steph@glondu.net>
Wed, 24 Jul 2019 07:08:39 +0000 (09:08 +0200)
committerStéphane Glondu <glondu@debian.org>
Wed, 7 Aug 2024 12:12:25 +0000 (14:12 +0200)
This fixes compilation on kfreebsd-*.

Forwarded: https://github.com/ocaml/ocaml/pull/8842

Gbp-Pq: Name 0003-Check-for-definition-of-AT_SECURE-before-using-it.patch

otherlibs/unix/envir_unix.c

index cef6cb0adbc61651cdc2ae9f280b614fbc198cd1..977db1c3f77a0cc58f398e74871b5bcfa58a72f6 100644 (file)
@@ -39,7 +39,7 @@ CAMLprim value caml_unix_environment_unsafe(value unit)
 
 static char **secure_environ(void)
 {
-#ifdef HAS_GETAUXVAL
+#if defined(HAS_GETAUXVAL) && defined(AT_SECURE)
   if (!getauxval(AT_SECURE))
     return environ;
   else