1 dnl ######################################################################
2 dnl Check if we have as buggy hasmntopt() libc function
3 AC_DEFUN([AMU_FUNC_BAD_HASMNTOPT],
5 AC_CACHE_CHECK([for working hasmntopt], ac_cv_func_hasmntopt_working,
10 /* some systems need <stdio.h> before <mntent.h> is included */
13 # endif /* HAVE_STDIO_H */
15 #endif /* HAVE_MNTENT_H */
16 #ifdef HAVE_SYS_MNTENT_H
17 # include <sys/mntent.h>
18 #endif /* HAVE_SYS_MNTENT_H */
19 #ifdef HAVE_SYS_MNTTAB_H
20 # include <sys/mnttab.h>
21 #endif /* HAVE_SYS_MNTTAB_H */
22 #if defined(HAVE_MNTTAB_H) && !defined(MNTTAB)
24 #endif /* defined(HAVE_MNTTAB_H) && !defined(MNTTAB) */
25 #ifdef HAVE_STRUCT_MNTENT
26 typedef struct mntent mntent_t;
27 #else /* not HAVE_STRUCT_MNTENT */
28 # ifdef HAVE_STRUCT_MNTTAB
29 typedef struct mnttab mntent_t;
30 /* map struct mnttab field names to struct mntent field names */
31 # define mnt_opts mnt_mntopts
32 # endif /* not HAVE_STRUCT_MNTTAB */
33 #endif /* not HAVE_STRUCT_MNTENT */
41 * Test if hasmntopt will incorrectly find the string "soft", which
42 * is part of the large "softlookup" function.
44 mnt.mnt_opts = "hard,softlookup,ro";
46 if ((tmp = hasmntopt(&mnt, "soft")))
51 [ac_cv_func_hasmntopt_working=yes],
52 [ac_cv_func_hasmntopt_working=no]
54 if test $ac_cv_func_hasmntopt_working = no
56 AC_LIBOBJ([hasmntopt])
57 AC_DEFINE(HAVE_BAD_HASMNTOPT)