| 1 |
# secure_getenv.m4 |
| 2 |
# serial 2 |
| 3 |
dnl Copyright 2013-2024 Free Software Foundation, Inc. |
| 4 |
dnl This file is free software; the Free Software Foundation |
| 5 |
dnl gives unlimited permission to copy and/or distribute it, |
| 6 |
dnl with or without modifications, as long as this notice is preserved. |
| 7 |
dnl This file is offered as-is, without any warranty. |
| 8 |
|
| 9 |
AC_DEFUN([gl_FUNC_SECURE_GETENV], |
| 10 |
[ |
| 11 |
dnl Persuade glibc <stdlib.h> to declare secure_getenv(). |
| 12 |
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) |
| 13 |
|
| 14 |
AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) |
| 15 |
AC_CHECK_FUNCS_ONCE([secure_getenv]) |
| 16 |
if test $ac_cv_func_secure_getenv = no; then |
| 17 |
HAVE_SECURE_GETENV=0 |
| 18 |
fi |
| 19 |
]) |
| 20 |
|
| 21 |
# Prerequisites of lib/secure_getenv.c. |
| 22 |
AC_DEFUN([gl_PREREQ_SECURE_GETENV], [ |
| 23 |
AC_CHECK_FUNCS([__secure_getenv]) |
| 24 |
if test $ac_cv_func___secure_getenv = no; then |
| 25 |
gl_CHECK_FUNCS_ANDROID([issetugid], [[#include <unistd.h>]]) |
| 26 |
fi |
| 27 |
AC_CHECK_FUNCS_ONCE([getuid geteuid getgid getegid]) |
| 28 |
]) |