-
-/* Teach libc5 about realpath -- it includes it but the
- * prototype is missing... */
-#if (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1)
-extern char *realpath(const char *path, char *resolved_path);
-#endif
-
-static const int MNT_FORCE = 1;
-static const int MS_MGC_VAL = 0xc0ed0000; /* Magic number indicatng "new" flags */
-static const int MS_REMOUNT = 32; /* Alter flags of a mounted FS. */
-static const int MS_RDONLY = 1; /* Mount read-only. */
-
-extern int mount (__const char *__special_file, __const char *__dir,
- __const char *__fstype, unsigned long int __rwflag,
- __const void *__data);
-extern int umount (__const char *__special_file);
-extern int umount2 (__const char *__special_file, int __flags);
-
-struct _mtab_entry_t {
- char *device;
- char *mountpt;
- struct _mtab_entry_t *next;
-};
-
-static struct _mtab_entry_t *mtab_cache = NULL;
-
-
-
-#if defined CONFIG_FEATURE_MOUNT_FORCE
-static int doForce = FALSE;
-#endif
-#if defined CONFIG_FEATURE_MOUNT_LOOP
-static int freeLoop = TRUE;
-#endif
-#if defined CONFIG_FEATURE_MTAB_SUPPORT
-static int useMtab = TRUE;
-#endif
-static int umountAll = FALSE;
-static int doRemount = FALSE;
-
-
-
-/* These functions are here because the getmntent functions do not appear
- * to be re-entrant, which leads to all sorts of problems when we try to
- * use them recursively - randolph
- *
- * TODO: Perhaps switch to using Glibc's getmntent_r
- * -Erik
- */
-static void mtab_read(void)
+#include <mntent.h>
+#include <getopt.h>
+
+#define OPTION_STRING "flDnravd"
+#define OPT_FORCE 1
+#define OPT_LAZY 2
+#define OPT_DONTFREELOOP 4
+#define OPT_NO_MTAB 8
+#define OPT_REMOUNT 16
+#define OPT_ALL (ENABLE_FEATURE_UMOUNT_ALL ? 32 : 0)
+
+int umount_main(int argc, char **argv);
+int umount_main(int argc, char **argv)