diff options
author | Mike Frsyinger <vapier@gentoo.org> | 2009-11-14 19:16:01 -0800 |
---|---|---|
committer | Petr Baudis <pasky@ucw.cz> | 2009-11-18 10:06:45 +0100 |
commit | c78e33c312e16a4faccf07278d45538f0252058f (patch) | |
tree | 3b4a425d7ed3d1ce62ded6b86d437a48f07a8af8 /sysdeps | |
parent | 3e224a852a7109e2efa1f07f15962235d12b7e63 (diff) | |
download | glibc-c78e33c312e16a4faccf07278d45538f0252058f.zip glibc-c78e33c312e16a4faccf07278d45538f0252058f.tar.gz glibc-c78e33c312e16a4faccf07278d45538f0252058f.tar.bz2 |
Fix building on x86 with older kernel headers.
Fix building on x86 when older linux headers lack __NR_fallocate define.
(cherry picked from commit f9a7bd536e0b1693db32e1330bbd96108ca63c42)
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/fallocate.c | 6 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/fallocate64.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/fallocate.c b/sysdeps/unix/sysv/linux/i386/fallocate.c index 7a943e4..14e7883 100644 --- a/sysdeps/unix/sysv/linux/i386/fallocate.c +++ b/sysdeps/unix/sysv/linux/i386/fallocate.c @@ -16,6 +16,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <errno.h> #include <fcntl.h> #include <sysdep.h> @@ -28,5 +29,10 @@ extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len) int fallocate (int fd, int mode, __off_t offset, __off_t len) { +#ifdef __NR_fallocate return __call_fallocate (fd, mode, offset, len); +#else + __set_errno (ENOSYS); + return -1; +#endif } diff --git a/sysdeps/unix/sysv/linux/i386/fallocate64.c b/sysdeps/unix/sysv/linux/i386/fallocate64.c index 4998f5e..85f315c 100644 --- a/sysdeps/unix/sysv/linux/i386/fallocate64.c +++ b/sysdeps/unix/sysv/linux/i386/fallocate64.c @@ -16,6 +16,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <errno.h> #include <fcntl.h> #include <sysdep.h> @@ -28,5 +29,10 @@ extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len) int fallocate64 (int fd, int mode, __off64_t offset, __off64_t len) { +#ifdef __NR_fallocate return __call_fallocate (fd, mode, offset, len); +#else + __set_errno (ENOSYS); + return -1; +#endif } |