summaryrefslogtreecommitdiff
path: root/patches/glibc/ports-2.10.1/130-i386-no-fallocate.patch
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-11-13 20:37:18 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-11-13 20:37:18 (GMT)
commit4b173045e97ab47f92bc27e9bef3a04f5742b263 (patch)
tree5c907ac100fc957240f4936d58c16a26554cfcdf /patches/glibc/ports-2.10.1/130-i386-no-fallocate.patch
parent590ca63f0dc6a548e2254d71b065efbf38ed85d8 (diff)
libc/glibc: add 2.10.1
Woo... It seems the glibc guys finally decided that tarballs were not deprecated, in fact. The patchset was vampirised from Gentoo (kudos, guys!), and applies to glibc+ports, so that's why it's been added as a patchset against ports, not against glibc.
Diffstat (limited to 'patches/glibc/ports-2.10.1/130-i386-no-fallocate.patch')
-rw-r--r--patches/glibc/ports-2.10.1/130-i386-no-fallocate.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/patches/glibc/ports-2.10.1/130-i386-no-fallocate.patch b/patches/glibc/ports-2.10.1/130-i386-no-fallocate.patch
new file mode 100644
index 0000000..a97362f
--- /dev/null
+++ b/patches/glibc/ports-2.10.1/130-i386-no-fallocate.patch
@@ -0,0 +1,55 @@
+Fix building on x86 when older linux headers lack __NR_fallocate define.
+
+URL: http://bugs.gentoo.org/274269
+Reported-by: Mikael Magnusson <mikachu@gmail.com>
+
+2009-11-09 Mike Frysinger <vapier@gentoo.org>
+
+ * sysdeps/unix/sysv/linux/i386/fallocate.c: Include errno.h.
+ (fallocate): Return ENOSYS if __NR_fallocate is not defined.
+ * sysdeps/unix/sysv/linux/i386/fallocate64.c: Likewise.
+
+diff -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/fallocate.c glibc-2.10.1/sysdeps/unix/sysv/linux/i386/fallocate.c
+--- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/fallocate.c 2009-03-02 17:11:06.000000000 +0100
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/i386/fallocate.c 2009-11-13 00:49:47.000000000 +0100
+@@ -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 @@
+ 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 -durN glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/fallocate64.c glibc-2.10.1/sysdeps/unix/sysv/linux/i386/fallocate64.c
+--- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/fallocate64.c 2009-03-02 17:10:29.000000000 +0100
++++ glibc-2.10.1/sysdeps/unix/sysv/linux/i386/fallocate64.c 2009-11-13 00:49:47.000000000 +0100
+@@ -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 @@
+ int
+ __fallocate64_l64 (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
+ }