On Tue, Jan 18, 2011 at 05:47:01PM +0100, Fabian Groffen wrote: > dirfd is not available on Solaris 10, it is available on latest > OpenSolaris releases though. Do some autoconf trickery to determine if > providing an alternative dirfd function is necessary and possible. > > Signed-off-by: Fabian Groffen <grobian@xxxxxxxxxx> > > diff --git a/configure.ac b/configure.ac > --- a/configure.ac > +++ b/configure.ac > @@ -226,6 +226,34 @@ > AC_SEARCH_LIBS([socket], [socket], [if test x"$ac_cv_search_socket" != x"none required"; then SOCKET_LIBS="$SOCKET_LIBS -lsocket"; fi]) > AC_SUBST(SOCKET_LIBS) > > +have_dirfd= > +AC_MSG_CHECKING([for dirfd]) > +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ > +#include <dirent.h> > +]],[[ > + DIR *dir = 0; > + if (dirfd(dir)) ; > +]])], [have_dirfd=yes], [have_dirfd=no]) > +AC_MSG_RESULT([$have_dirfd]) What about: AC_CHECK_FUNCS(dirfd) AC_CHECK_DECLS([dirfd], , , [#include <sys/types.h> #include <dirent.h>]) > +have_ddfd= > +if test x"$have_dirfd" = xno ; then > + AC_MSG_CHECKING([for dd_fd member in struct dirent]) > + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ > +#include <dirent.h> > +]],[[ > + DIR *dir = 0; > + if (dir->dd_fd) ; > + ]])], [have_ddfd=yes], [have_ddfd=no]) > + AC_MSG_RESULT([$have_ddfd]) > +fi and: AC_CHECK_MEMBERS([DIR.dd_fd],,,[ [#include <sys/types.h> #include <dirent.h>]]) Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html