1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

Test for clearenv function

clearenv() may not be provided by non-glibc systems.  As a fallback,
just set environ to NULL.

* libguile/posix.c (scm_environ)[!HAVE_CLEARENV]: add fallback logic
    for clearenv()
This commit is contained in:
Michael Gran 2023-07-17 16:07:37 -07:00
parent b9a40cdc18
commit df225a87b9
2 changed files with 7 additions and 1 deletions

View file

@ -516,6 +516,7 @@ AC_CHECK_HEADERS([crt_externs.h])
# sendfile - non-POSIX, found in glibc
# pipe2 - non-POSIX, found in glibc (GNU/Linux and GNU/Hurd)
# posix_spawn_file_actions_addclosefrom_np - glibc >= 2.34
#...clearenv - non-POSIX, found in glibc
#
AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid \
fesetround ftime ftruncate fchown fchownat fchmod fchdir readlinkat \
@ -530,7 +531,8 @@ AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid \
strcoll_l strtod_l strtol_l newlocale uselocale utimensat \
fstatat futimens openat \
sched_getaffinity sched_setaffinity sendfile pipe2 \
posix_spawn_file_actions_addclosefrom_np])
posix_spawn_file_actions_addclosefrom_np \
clearenv])
# The newlib C library uses _NL_ prefixed locale langinfo constants.
AC_CHECK_DECLS([_NL_NUMERIC_GROUPING], [], [], [[#include <langinfo.h>]])