]> Zhao Yanbai Git Server - minix.git/commitdiff
Enable getmntinfo(3) 35/935/2
authorDavid van Moolenbroek <david@minix3.org>
Mon, 19 Aug 2013 23:33:43 +0000 (01:33 +0200)
committerLionel Sambuc <lionel@minix3.org>
Tue, 18 Feb 2014 10:25:02 +0000 (11:25 +0100)
Change-Id: Ida9b0660471bb9fde3cdca6c9b9fd9e94341e02f

lib/libc/gen/Makefile.inc
sbin/newfs_ext2fs/newfs_ext2fs.c
sys/sys/statvfs.h

index 142fbb3188dee6747f0675cb775ceccb220424d6..85fcb7573d6a002c06f80d524e451d4a7d7fff83 100644 (file)
@@ -9,7 +9,7 @@
 
 .if defined(__MINIX)
 # Unsupported by Minix.
-#      closefrom.c confstr.c extattr.c getdevmajor.c getmntinfo.c \
+#      closefrom.c confstr.c extattr.c getdevmajor.c \
 #      pthread_atfork.c setdomainname.c sethostname.c setproctitle.c \
 #      sysctl.c sysctlbyname.c sysctlgetmibinfo.c sysctlnametomib.c \
 #      devname.c wait3.c
@@ -32,7 +32,7 @@ SRCS+=        _errno.c alarm.c alphasort.c arc4random.c assert.c basename.c clock.c \
        fts.c ftw.c getbsize.c getcap.c getcwd.c \
        getdomainname.c getgrent.c \
        getgrouplist.c getgroupmembership.c gethostname.c \
-       getloadavg.c getlogin.c \
+       getloadavg.c getlogin.c getmntinfo.c \
        getnetgrent.c getpagesize.c \
        getpass.c getprogname.c getpwent.c getttyent.c \
        getusershell.c glob.c humanize_number.c initdir.c initgroups.c \
index f3cc5ad893cf3aa6280ca471cff54d0782e33425..1c79f8467edece8f4a79d7502cf835540484dfcd 100644 (file)
@@ -136,12 +136,12 @@ main(int argc, char *argv[])
 #ifndef __minix
        struct disk_geom geo;
        struct dkwedge_info dkw;
-       struct statvfs *mp;
-       char *s2;
-       int len, n;
 #else
        u64_t minix_fssize;
 #endif
+       struct statvfs *mp;
+       char *s2;
+       int len, n;
        struct stat sb;
        int ch, fsi, fso, Fflag, Iflag, Zflag;
        char *cp, *s1, *special;
@@ -280,7 +280,6 @@ main(int argc, char *argv[])
                if (fsi < 0 || fstat(fsi, &sb) == -1)
                        err(EXIT_FAILURE, "%s: open for read", special);
 
-#ifndef __minix
                if (!Nflag) {
                        fso = open(special, O_WRONLY, 0);
                        if (fso < 0)
@@ -312,6 +311,7 @@ main(int argc, char *argv[])
                        }
                }
 
+#ifndef __minix
                if (getdiskinfo(special, fsi, disktype, &geo, &dkw) == -1)
                        errx(EXIT_FAILURE, lmsg, special);
 
@@ -335,12 +335,6 @@ main(int argc, char *argv[])
                        }
                }
 #else
-        {
-               fso = open(special, O_WRONLY, 0);
-               if (fso < 0)
-                       err(EXIT_FAILURE,
-                           "%s: open for write", special);
-
                if(minix_sizeup(special, &minix_fssize) < 0)
                        errx(EXIT_FAILURE, "minix_sizeup failed");
 
@@ -349,7 +343,6 @@ main(int argc, char *argv[])
 
                if (sectorsize == 0)
                        sectorsize = 512;
-        }
 #endif
        }
 
index 5a17b255d2ba7ed2098e61e33dbe48daa622bd9c..c6a92df5d3cbce78044eb134d129462045817e91 100644 (file)
@@ -118,6 +118,9 @@ __BEGIN_DECLS
 int    statvfs(const char *__restrict, struct statvfs *__restrict);
 int    fstatvfs(int, struct statvfs *);
 int    getvfsstat(struct statvfs *, size_t, int);
+#ifndef __LIBC12_SOURCE__
+int    getmntinfo(struct statvfs **, int) __RENAME(__getmntinfo13);
+#endif /* __LIBC12_SOURCE__ */
 
 int    statvfs1(const char *__restrict, struct statvfs *__restrict, int);
 int    fstatvfs1(int, struct statvfs *, int);