summaryrefslogtreecommitdiff
path: root/libc/misc/statfs
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc/statfs')
-rw-r--r--libc/misc/statfs/fstatfs64.c19
-rw-r--r--libc/misc/statfs/fstatvfs.c8
-rw-r--r--libc/misc/statfs/fstatvfs64.c9
-rw-r--r--libc/misc/statfs/internal_statvfs.c48
-rw-r--r--libc/misc/statfs/statfs64.c18
-rw-r--r--libc/misc/statfs/statvfs.c7
-rw-r--r--libc/misc/statfs/statvfs64.c6
7 files changed, 57 insertions, 58 deletions
diff --git a/libc/misc/statfs/fstatfs64.c b/libc/misc/statfs/fstatfs64.c
index 63bd640b7..89ab5107d 100644
--- a/libc/misc/statfs/fstatfs64.c
+++ b/libc/misc/statfs/fstatfs64.c
@@ -18,10 +18,6 @@
02111-1307 USA. */
#include <features.h>
-#undef __fstatfs64
-#undef __fstatfs
-
-#ifdef __UCLIBC_HAS_LFS__
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64
#undef _FILE_OFFSET_BITS
@@ -42,13 +38,15 @@
#include <sys/statvfs.h>
#include <stddef.h>
-#undef fstatfs64
+libc_hidden_proto(memcpy)
+libc_hidden_proto(fstatfs)
+
/* Return information about the filesystem on which FD resides. */
-int attribute_hidden __fstatfs64 (int fd, struct statfs64 *buf)
+int fstatfs64 (int fd, struct statfs64 *buf)
{
struct statfs buf32;
- if (__fstatfs (fd, &buf32) < 0)
+ if (fstatfs (fd, &buf32) < 0)
return -1;
buf->f_type = buf32.f_type;
@@ -60,10 +58,9 @@ int attribute_hidden __fstatfs64 (int fd, struct statfs64 *buf)
buf->f_ffree = buf32.f_ffree;
buf->f_fsid = buf32.f_fsid;
buf->f_namelen = buf32.f_namelen;
- __memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare));
+ memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare));
return 0;
}
-strong_alias(__fstatfs64,fstatfs64)
-
-#endif /* __UCLIBC_HAS_LFS__ */
+libc_hidden_proto(fstatfs64)
+libc_hidden_def(fstatfs64)
diff --git a/libc/misc/statfs/fstatvfs.c b/libc/misc/statfs/fstatvfs.c
index 14ef6ecce..a3d0ef97c 100644
--- a/libc/misc/statfs/fstatvfs.c
+++ b/libc/misc/statfs/fstatvfs.c
@@ -29,16 +29,20 @@
#include <sys/statfs.h>
#include <sys/statvfs.h>
+libc_hidden_proto(fstatfs)
+libc_hidden_proto(fstat)
+libc_hidden_proto(stat)
+
int fstatvfs (int fd, struct statvfs *buf)
{
struct statfs fsbuf;
struct stat st;
/* Get as much information as possible from the system. */
- if (__fstatfs (fd, &fsbuf) < 0)
+ if (fstatfs (fd, &fsbuf) < 0)
return -1;
-#define STAT(st) __fstat (fd, st)
+#define STAT(st) fstat (fd, st)
#include "internal_statvfs.c"
/* We signal success if the statfs call succeeded. */
diff --git a/libc/misc/statfs/fstatvfs64.c b/libc/misc/statfs/fstatvfs64.c
index 993caf955..d97895a10 100644
--- a/libc/misc/statfs/fstatvfs64.c
+++ b/libc/misc/statfs/fstatvfs64.c
@@ -19,7 +19,6 @@
#include <features.h>
-#ifdef __UCLIBC_HAS_LFS__
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64
#undef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
@@ -30,7 +29,6 @@
#ifndef __USE_LARGEFILE64
# define __USE_LARGEFILE64 1
#endif
-#endif
#define __USE_GNU
#include <errno.h>
@@ -42,16 +40,19 @@
#include <sys/statfs.h>
#include <sys/statvfs.h>
+//libc_hidden_proto(fstatfs)
+//libc_hidden_proto(fstat)
+
int fstatvfs (int fd, struct statvfs *buf)
{
struct statfs fsbuf;
struct stat st;
/* Get as much information as possible from the system. */
- if (__fstatfs (fd, &fsbuf) < 0)
+ if (fstatfs (fd, &fsbuf) < 0)
return -1;
-#define STAT(st) __fstat (fd, st)
+#define STAT(st) fstat (fd, st)
#include "internal_statvfs.c"
/* We signal success if the statfs call succeeded. */
diff --git a/libc/misc/statfs/internal_statvfs.c b/libc/misc/statfs/internal_statvfs.c
index d41c3052d..2d561976e 100644
--- a/libc/misc/statfs/internal_statvfs.c
+++ b/libc/misc/statfs/internal_statvfs.c
@@ -17,18 +17,12 @@
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;
+libc_hidden_proto(memset)
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strsep)
+libc_hidden_proto(setmntent)
+libc_hidden_proto(getmntent_r)
+libc_hidden_proto(endmntent)
/* Now fill in the fields we have information for. */
buf->f_bsize = fsbuf.f_bsize;
@@ -52,7 +46,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 +64,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,22 +85,22 @@ 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)
+ 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;
/* We can stop looking for more entries. */
@@ -115,7 +109,7 @@ extern char *__strsep (char **__restrict __stringp,
}
/* Close the file. */
- __endmntent (mtab);
+ endmntent (mtab);
}
__set_errno (save_errno);
diff --git a/libc/misc/statfs/statfs64.c b/libc/misc/statfs/statfs64.c
index 9d326f1f8..230b89b9c 100644
--- a/libc/misc/statfs/statfs64.c
+++ b/libc/misc/statfs/statfs64.c
@@ -18,8 +18,6 @@
02111-1307 USA. */
#include <features.h>
-#undef __statfs64
-#undef __statfs
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64
#undef _FILE_OFFSET_BITS
@@ -38,14 +36,15 @@
#include <stddef.h>
#include <sys/statfs.h>
-#if defined __UCLIBC_HAS_LFS__
-#undef statfs64
+libc_hidden_proto(memcpy)
+libc_hidden_proto(statfs)
+
/* Return information about the filesystem on which FILE resides. */
-int attribute_hidden __statfs64 (const char *file, struct statfs64 *buf)
+int statfs64 (const char *file, struct statfs64 *buf)
{
struct statfs buf32;
- if (__statfs (file, &buf32) < 0)
+ if (statfs (file, &buf32) < 0)
return -1;
buf->f_type = buf32.f_type;
@@ -57,10 +56,9 @@ int attribute_hidden __statfs64 (const char *file, struct statfs64 *buf)
buf->f_ffree = buf32.f_ffree;
buf->f_fsid = buf32.f_fsid;
buf->f_namelen = buf32.f_namelen;
- __memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare));
+ memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare));
return 0;
}
-strong_alias(__statfs64,statfs64)
-
-#endif
+libc_hidden_proto(statfs64)
+libc_hidden_def(statfs64)
diff --git a/libc/misc/statfs/statvfs.c b/libc/misc/statfs/statvfs.c
index a7c553fb6..795126a7b 100644
--- a/libc/misc/statfs/statvfs.c
+++ b/libc/misc/statfs/statvfs.c
@@ -29,16 +29,19 @@
#include <sys/statfs.h>
#include <sys/statvfs.h>
+libc_hidden_proto(statfs)
+libc_hidden_proto(stat)
+
int statvfs (const char *file, struct statvfs *buf)
{
struct statfs fsbuf;
struct stat st;
/* Get as much information as possible from the system. */
- if (__statfs (file, &fsbuf) < 0)
+ if (statfs (file, &fsbuf) < 0)
return -1;
-#define STAT(st) __stat (file, st)
+#define STAT(st) stat (file, st)
#include "internal_statvfs.c"
/* We signal success if the statfs call succeeded. */
diff --git a/libc/misc/statfs/statvfs64.c b/libc/misc/statfs/statvfs64.c
index dc2458f5f..ccde33757 100644
--- a/libc/misc/statfs/statvfs64.c
+++ b/libc/misc/statfs/statvfs64.c
@@ -42,6 +42,8 @@
#include <sys/statfs.h>
#include <sys/statvfs.h>
+//libc_hidden_proto(statfs)
+//libc_hidden_proto(stat)
int statvfs (const char *file, struct statvfs *buf)
{
@@ -49,10 +51,10 @@ int statvfs (const char *file, struct statvfs *buf)
struct stat st;
/* Get as much information as possible from the system. */
- if (__statfs (file, &fsbuf) < 0)
+ if (statfs (file, &fsbuf) < 0)
return -1;
-#define STAT(st) __stat (file, st)
+#define STAT(st) stat (file, st)
#include "internal_statvfs.c"
/* We signal success if the statfs call succeeded. */