Provide an alternate getmntent() if necessary.

CVS patchset: 1679
CVS date: 1997/06/02 19:59:07
This commit is contained in:
ewt 1997-06-02 19:59:07 +00:00
parent 79b6469198
commit 9b9de6ce15
3 changed files with 26 additions and 13 deletions

View File

@ -83,4 +83,8 @@
/* Define as one if you have <sys/mnttab.h> */
#define HAVE_SYS_MNTTAB_H 0
/* Define as one if you have getmntent(), you'll also need one of the above
two defined */
#define HAVE_GETMNTENT 0
#endif

View File

@ -277,6 +277,7 @@ fi
dnl Checks for library functions.
AC_CHECK_FUNC(inet_aton, AC_DEFINE(HAVE_INET_ATON), MISCOBJS="$MISCOBJS inet_aton.o")
AC_CHECK_FUNC(realpath, AC_DEFINE(HAVE_REALPATH), MISCOBJS="$MISCOBJS realpath.o")
AC_CHECK_FUNC(getmntent, AC_DEFINE(HAVE_GETMNTENT), MISCOBJS="$MISCOBJS getmntent.o")
AC_CHECK_FUNC(strerror, [], MISCOBJS="$MISCOBJS strerror.o")
AC_CHECK_FUNC(strtol, [], MISCOBJS="$MISCOBJS strtol.o")
AC_CHECK_FUNC(strtoul, [], MISCOBJS="$MISCOBJS strtoul.o")

View File

@ -62,21 +62,29 @@ extern void *myrealloc(void *, size_t);
#define lchown chown
#endif
#if HAVE_MNTENT_H
#include <mntent.h>
#define GETMNTENT_ONE 1
#define GETMNTENT_TWO 0
#define our_mntent struct mntent
#define our_mntdir mnt_dir
#if HAVE_MNTENT_H || !(HAVE_GETMNTENT)
# if HAVE_MNTENT_H
# include <mntent.h>
# else
#include <stdio.h>
struct mntent {
char * mnt_dir;
};
struct mntent *getmntent(FILE *filep);
# endif
# define GETMNTENT_ONE 1
# define GETMNTENT_TWO 0
# define our_mntent struct mntent
# define our_mntdir mnt_dir
#elif HAVE_SYS_MNTTAB_H
#include <stdio.h>
#include <sys/mnttab.h>
#define GETMNTENT_ONE 0
#define GETMNTENT_TWO 1
#define our_mntdir mnt_mountp
#define our_mntent struct mnttab
# include <stdio.h>
# include <sys/mnttab.h>
# define GETMNTENT_ONE 0
# define GETMNTENT_TWO 1
# define our_mntent struct mnttab
# define our_mntdir mnt_mountp
#else
#error Neither mntent.h nor mnttab.h exists. I cannot build on this system.
# error Neither mntent.h nor mnttab.h exists. I cannot build on this system.
#endif
#ifndef MOUNTED