summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/statfs64.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-03-31 01:56:09 +0000
committerEric Andersen <andersen@codepoet.org>2002-03-31 01:56:09 +0000
commit9116dff92e5b362011431f073fe6aa98327be254 (patch)
tree2e7c935ef2a7d79c17a0bb47b5c1663ed465336a /libc/sysdeps/linux/common/statfs64.c
parent8ba7d3bab5a6510fa5ee12d033eb0a26966ea3d3 (diff)
Add support for getrlimit64 and setrlimit64. Fix some problems
with the getrlimit and setrlimit syscalls. -Erik
Diffstat (limited to 'libc/sysdeps/linux/common/statfs64.c')
-rw-r--r--libc/sysdeps/linux/common/statfs64.c50
1 files changed, 30 insertions, 20 deletions
diff --git a/libc/sysdeps/linux/common/statfs64.c b/libc/sysdeps/linux/common/statfs64.c
index 2a0a930c4..7d5060914 100644
--- a/libc/sysdeps/linux/common/statfs64.c
+++ b/libc/sysdeps/linux/common/statfs64.c
@@ -19,34 +19,44 @@
#include <features.h>
-#ifdef __UCLIBC_HAVE_LFS__
-#define __USE_LARGEFILE64
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64
+#undef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
+#ifndef __USE_FILE_OFFSET64
+# define __USE_FILE_OFFSET64 1
+#endif
+#ifndef __USE_LARGEFILE64
+# define __USE_LARGEFILE64 1
+#endif
-#include <errno.h>
#include <string.h>
#include <stddef.h>
#include <sys/statfs.h>
+
+#if defined __UCLIBC_HAVE_LFS__
+
/* Return information about the filesystem on which FILE resides. */
int statfs64 (const char *file, struct statfs64 *buf)
{
- struct statfs buf32;
-
- if (statfs (file, &buf32) < 0)
- return -1;
-
- buf->f_type = buf32.f_type;
- buf->f_bsize = buf32.f_bsize;
- buf->f_blocks = buf32.f_blocks;
- buf->f_bfree = buf32.f_bfree;
- buf->f_bavail = buf32.f_bavail;
- buf->f_files = buf32.f_files;
- 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));
-
- return 0;
+ struct statfs buf32;
+
+ if (statfs (file, &buf32) < 0)
+ return -1;
+
+ buf->f_type = buf32.f_type;
+ buf->f_bsize = buf32.f_bsize;
+ buf->f_blocks = buf32.f_blocks;
+ buf->f_bfree = buf32.f_bfree;
+ buf->f_bavail = buf32.f_bavail;
+ buf->f_files = buf32.f_files;
+ 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));
+
+ return 0;
}
#endif