From: Ryan S. Arnold Date: Fri, 24 Jul 2009 15:49:00 +0000 (-0500) Subject: Handle old kernel headers with new fallocate patches. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3353ea9028f569552e12bef515582a48c49100e0;p=thirdparty%2Fglibc.git Handle old kernel headers with new fallocate patches. commit 353f210707092e3e57418b4954888f2d15cc3da3 Author: Ulrich Drepper Date: Wed Apr 15 00:39:57 2009 +0000 2009-03-17 Ryan S. Arnold Ulrich Drepper * sysdeps/unix/sysv/linux/fallocate.c: Handle old kernel headers. * sysdeps/unix/sysv/linux/fallocate64.c: Likewise. --- diff --git a/sysdeps/unix/sysv/linux/fallocate.c b/sysdeps/unix/sysv/linux/fallocate.c index a45b0f831d3..116f00046ed 100644 --- a/sysdeps/unix/sysv/linux/fallocate.c +++ b/sysdeps/unix/sysv/linux/fallocate.c @@ -25,7 +25,12 @@ int fallocate (int fd, int mode, __off_t offset, __off_t len) { +#ifndef __NR_fallocate return INLINE_SYSCALL (fallocate, 6, fd, mode, __LONG_LONG_PAIR (offset >> 31, offset), __LONG_LONG_PAIR (len >> 31, len)); +#else + __set_errno (ENOSYS); + return -1; +#endif } diff --git a/sysdeps/unix/sysv/linux/fallocate64.c b/sysdeps/unix/sysv/linux/fallocate64.c index 601a70ba1fe..2fbe988910a 100644 --- a/sysdeps/unix/sysv/linux/fallocate64.c +++ b/sysdeps/unix/sysv/linux/fallocate64.c @@ -25,9 +25,14 @@ int __fallocate64_l64 (int fd, int mode, __off64_t offset, __off64_t len) { +#ifndef __NR_fallocate return INLINE_SYSCALL (fallocate, 6, fd, mode, __LONG_LONG_PAIR ((long int) (offset >> 32), (long int) offset), __LONG_LONG_PAIR ((long int) (len >> 32), (long int) len)); +#else + __set_errno (ENOSYS); + return -1; +#endif }