diff options
| author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-02-28 00:08:19 +0000 |
|---|---|---|
| committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-02-28 00:08:19 +0000 |
| commit | 316667d1503d39e79db42ed4f0091bfa99814b92 (patch) | |
| tree | f19838d4585e9807b8cc8aef1b6105b651dc3711 /libc/misc/statfs/internal_statvfs.c | |
| parent | e52a11db3dcc50f2dd72c3f5871afc1d432507de (diff) | |
| download | uClibc-alpine-316667d1503d39e79db42ed4f0091bfa99814b92.tar.bz2 uClibc-alpine-316667d1503d39e79db42ed4f0091bfa99814b92.tar.xz | |
Merge from trunk.
Diffstat (limited to 'libc/misc/statfs/internal_statvfs.c')
| -rw-r--r-- | libc/misc/statfs/internal_statvfs.c | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/libc/misc/statfs/internal_statvfs.c b/libc/misc/statfs/internal_statvfs.c index d41c3052d..6075e9cf4 100644 --- a/libc/misc/statfs/internal_statvfs.c +++ b/libc/misc/statfs/internal_statvfs.c @@ -17,19 +17,6 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -extern FILE *__setmntent (__const char *__file, __const char *__mode) __THROW attribute_hidden; - -extern struct mntent *__getmntent_r (FILE *__restrict __stream, - struct mntent *__restrict __result, - char *__restrict __buffer, - int __bufsize) __THROW attribute_hidden; - -extern int __endmntent (FILE *__stream) __THROW attribute_hidden; - -extern char *__strsep (char **__restrict __stringp, - __const char *__restrict __delim) - __THROW __nonnull ((1, 2)) attribute_hidden; - /* Now fill in the fields we have information for. */ buf->f_bsize = fsbuf.f_bsize; /* Linux does not support f_frsize, so set it to the full block size. */ @@ -52,7 +39,7 @@ extern char *__strsep (char **__restrict __stringp, buf->__f_unused = 0; #endif buf->f_namemax = fsbuf.f_namelen; - __memset (buf->__f_spare, '\0', 6 * sizeof (int)); + memset (buf->__f_spare, '\0', 6 * sizeof (int)); /* What remains to do is to fill the fields f_favail and f_flag. */ @@ -70,20 +57,20 @@ extern char *__strsep (char **__restrict __stringp, struct mntent mntbuf; FILE *mtab; - mtab = __setmntent ("/proc/mounts", "r"); + mtab = setmntent ("/proc/mounts", "r"); if (mtab == NULL) - mtab = __setmntent (_PATH_MOUNTED, "r"); + mtab = setmntent (_PATH_MOUNTED, "r"); if (mtab != NULL) { char tmpbuf[1024]; - while (__getmntent_r (mtab, &mntbuf, tmpbuf, sizeof (tmpbuf))) + while (getmntent_r (mtab, &mntbuf, tmpbuf, sizeof (tmpbuf))) { struct stat fsst; /* Find out about the device the current entry is for. */ - if (__stat (mntbuf.mnt_dir, &fsst) >= 0 + if (stat (mntbuf.mnt_dir, &fsst) >= 0 && st.st_dev == fsst.st_dev) { /* Bingo, we found the entry for the device FD is on. @@ -91,23 +78,25 @@ extern char *__strsep (char **__restrict __stringp, char *cp = mntbuf.mnt_opts; char *opt; - while ((opt = __strsep (&cp, ",")) != NULL) - if (__strcmp (opt, "ro") == 0) + while ((opt = strsep (&cp, ",")) != NULL) + if (strcmp (opt, "ro") == 0) buf->f_flag |= ST_RDONLY; - else if (__strcmp (opt, "nosuid") == 0) + else if (strcmp (opt, "nosuid") == 0) buf->f_flag |= ST_NOSUID; - else if (__strcmp (opt, "noexec") == 0) +#ifdef __USE_GNU + else if (strcmp (opt, "noexec") == 0) buf->f_flag |= ST_NOEXEC; - else if (__strcmp (opt, "nodev") == 0) + else if (strcmp (opt, "nodev") == 0) buf->f_flag |= ST_NODEV; - else if (__strcmp (opt, "sync") == 0) + else if (strcmp (opt, "sync") == 0) buf->f_flag |= ST_SYNCHRONOUS; - else if (__strcmp (opt, "mand") == 0) + else if (strcmp (opt, "mand") == 0) buf->f_flag |= ST_MANDLOCK; - else if (__strcmp (opt, "noatime") == 0) + else if (strcmp (opt, "noatime") == 0) buf->f_flag |= ST_NOATIME; - else if (__strcmp (opt, "nodiratime") == 0) + else if (strcmp (opt, "nodiratime") == 0) buf->f_flag |= ST_NODIRATIME; +#endif /* We can stop looking for more entries. */ break; @@ -115,7 +104,7 @@ extern char *__strsep (char **__restrict __stringp, } /* Close the file. */ - __endmntent (mtab); + endmntent (mtab); } __set_errno (save_errno); |
