]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix building on x86 with older kernel headers.
authorMike Frsyinger <vapier@gentoo.org>
Sun, 15 Nov 2009 03:16:01 +0000 (19:16 -0800)
committerUlrich Drepper <drepper@redhat.com>
Sun, 15 Nov 2009 03:16:01 +0000 (19:16 -0800)
Fix building on x86 when older linux headers lack __NR_fallocate define.

sysdeps/unix/sysv/linux/i386/fallocate.c
sysdeps/unix/sysv/linux/i386/fallocate64.c

index 7a943e44c0cca9ae0b76b38d6bccb167be0bdaf8..14e788386cb02f3750c1a7856be928766ed263d0 100644 (file)
@@ -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
 }
index 4998f5e644586067bbb31800c18974a419ed76ec..85f315c9b68abaa770db91dc2609d4d32f997cca 100644 (file)
@@ -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
 }