/* Define as one if you have mntctl() (only aix?) */
#define HAVE_MNTCTL 0
+/* Define as one if you have "struct mnttab" (only sco?) */
+#define HAVE_STRUCT_MNTTAB 0
+
#endif
echo "hacking things up for sco"
RPM=rpm.shared
AC_DEFINE(NEED_STRINGS_H)
+ AC_DEFINE(HAVE_STRUCT_MNTTAB)
elif echo "$build_os" | grep sunos > /dev/null; then
echo "hacking things up for sunos"
CFLAGS="$CFLAGS -D__USE_FIXED_PROTOTYPES__"
#define COMMENTCHAR '#'
#endif
+#if HAVE_STRUCT_MNTTAB {
+our_mntent * getmntent(FILE *filep) {
+ static struct mnttab entry;
+ static our_mntent item = { entry.mt_filsys };
+
+ if (!fread(&entry, sizeof(entry), 1, filep)) return NULL;
+
+ return &item;
+}
+#else {
our_mntent *getmntent(FILE *filep) {
static our_mntent item = { NULL };
char buf[1024], * start;
return NULL;
}
+}
#define lchown chown
#endif
-#if HAVE_MNTENT_H || !(HAVE_GETMNTENT)
-# if HAVE_MNTENT_H
+#if HAVE_MNTENT_H || !(HAVE_GETMNTENT) || HAVE_STRUCT_MNTTAB
+# if HAVE_MNTENT_H || HAVE_STRUCT_MNTTAB
# include <mntent.h>
# define our_mntent struct mntent
# define our_mntdir mnt_dir
# define GETMNTENT_TWO 1
# define our_mntent struct mnttab
# define our_mntdir mnt_mountp
+#define
#else if !HAVE_MNTCTL
# error Neither mntent.h, mnttab.h, or mntctl() exists. I cannot build on this system.
#endif