3 dnl Copyright (C) 2010-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.
8 AC_DEFUN([gl_FUNC_GRANTPT],
10 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
12 dnl Persuade glibc <stdlib.h> to declare grantpt().
13 AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
15 dnl We can't use AC_CHECK_FUNC here, because grantpt() is defined as a
16 dnl static inline function when compiling for Android 4.4 or older.
17 AC_CACHE_CHECK([for grantpt], [gl_cv_func_grantpt],
20 [[#include <stdlib.h>]],
21 [[return grantpt(0);]])
23 [gl_cv_func_grantpt=yes],
24 [gl_cv_func_grantpt=no])
26 if test $gl_cv_func_grantpt = no; then
31 # Prerequisites of lib/grantpt.c.
32 AC_DEFUN([gl_PREREQ_GRANTPT], [
33 AC_CHECK_FUNCS([setrlimit])