From 9116dff92e5b362011431f073fe6aa98327be254 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Sun, 31 Mar 2002 01:56:09 +0000 Subject: Add support for getrlimit64 and setrlimit64. Fix some problems with the getrlimit and setrlimit syscalls. -Erik --- libc/sysdeps/linux/common/statfs64.c | 50 +++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 20 deletions(-) (limited to 'libc/sysdeps/linux/common/statfs64.c') 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 -#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 #include #include #include + +#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 -- cgit v1.2.3