+ return (FALSE);
+ }
+ return (TRUE);
+}
+
+extern int mount_main(int argc, char **argv)
+{
+ char string_flags_buf[1024] = "";
+ char *string_flags = string_flags_buf;
+ char *extra_opts = string_flags_buf;
+ unsigned long flags = 0;
+ char *filesystemType = "auto";
+ char *device = NULL;
+ char *directory = NULL;
+ int all = FALSE;
+ int fakeIt = FALSE;
+ int useMtab = TRUE;
+ int i;
+
+#if defined BB_FEATURE_USE_DEVPS_PATCH
+ if (argc == 1) {
+ int fd, i, numfilesystems;
+ char device[] = "/dev/mtab";
+ struct k_mntent *mntentlist;
+
+ /* open device */
+ fd = open(device, O_RDONLY);
+ if (fd < 0)
+ fatalError("open failed for `%s': %s\n", device, strerror (errno));
+
+ /* How many mounted filesystems? We need to know to
+ * allocate enough space for later... */
+ numfilesystems = ioctl (fd, DEVMTAB_COUNT_MOUNTS);
+ if (numfilesystems<0)
+ fatalError( "\nDEVMTAB_COUNT_MOUNTS: %s\n", strerror (errno));
+ mntentlist = (struct k_mntent *) calloc ( numfilesystems, sizeof(struct k_mntent));
+
+ /* Grab the list of mounted filesystems */
+ if (ioctl (fd, DEVMTAB_GET_MOUNTS, mntentlist)<0)
+ fatalError( "\nDEVMTAB_GET_MOUNTS: %s\n", strerror (errno));
+
+ for( i = 0 ; i < numfilesystems ; i++) {
+ fprintf( stdout, "%s %s %s %s %d %d\n", mntentlist[i].mnt_fsname,
+ mntentlist[i].mnt_dir, mntentlist[i].mnt_type,
+ mntentlist[i].mnt_opts, mntentlist[i].mnt_freq,
+ mntentlist[i].mnt_passno);