3 # On some systems (e.g., HPUX-10.20, SunOS4.1.4, solaris2.5.1), mkstemp has the
4 # silly limit that it can create no more than 26 files from a given template.
5 # Other systems lack mkstemp altogether. On either type of system, arrange
6 # to use the replacement function.
7 AC_DEFUN([UTILS_FUNC_MKSTEMP],
9 AC_REPLACE_FUNCS(mkstemp)
10 if test $ac_cv_func_mkstemp = no; then
11 utils_cv_func_mkstemp_limitations=yes
13 AC_CACHE_CHECK([for mkstemp limitations],
14 utils_cv_func_mkstemp_limitations,
21 for (i = 0; i < 30; i++)
23 char template[] = "conftestXXXXXX";
24 int fd = mkstemp (template);
32 utils_cv_func_mkstemp_limitations=no,
33 utils_cv_func_mkstemp_limitations=yes,
34 utils_cv_func_mkstemp_limitations=yes
40 if test $utils_cv_func_mkstemp_limitations = yes; then
43 AC_DEFINE(mkstemp, rpl_mkstemp,
44 [Define to rpl_mkstemp if the replacement function should be used.])