yann@1625: Fix building on x86 when older linux headers lack __NR_fallocate define. yann@1625: yann@1625: URL: http://bugs.gentoo.org/274269 yann@1625: Reported-by: Mikael Magnusson yann@1625: yann@1625: 2009-11-09 Mike Frysinger yann@1625: yann@1625: * sysdeps/unix/sysv/linux/i386/fallocate.c: Include errno.h. yann@1625: (fallocate): Return ENOSYS if __NR_fallocate is not defined. yann@1625: * sysdeps/unix/sysv/linux/i386/fallocate64.c: Likewise. yann@1625: yann@1625: 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 yann@1625: --- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/fallocate.c 2009-03-02 17:11:06.000000000 +0100 yann@1625: +++ glibc-2.10.1/sysdeps/unix/sysv/linux/i386/fallocate.c 2009-11-13 00:49:47.000000000 +0100 yann@1625: @@ -16,6 +16,7 @@ yann@1625: Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA yann@1625: 02111-1307 USA. */ yann@1625: yann@1625: +#include yann@1625: #include yann@1625: #include yann@1625: yann@1625: @@ -28,5 +29,10 @@ yann@1625: int yann@1625: fallocate (int fd, int mode, __off_t offset, __off_t len) yann@1625: { yann@1625: +#ifdef __NR_fallocate yann@1625: return __call_fallocate (fd, mode, offset, len); yann@1625: +#else yann@1625: + __set_errno (ENOSYS); yann@1625: + return -1; yann@1625: +#endif yann@1625: } yann@1625: 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 yann@1625: --- glibc-2.10.1.orig/sysdeps/unix/sysv/linux/i386/fallocate64.c 2009-03-02 17:10:29.000000000 +0100 yann@1625: +++ glibc-2.10.1/sysdeps/unix/sysv/linux/i386/fallocate64.c 2009-11-13 00:49:47.000000000 +0100 yann@1625: @@ -16,6 +16,7 @@ yann@1625: Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA yann@1625: 02111-1307 USA. */ yann@1625: yann@1625: +#include yann@1625: #include yann@1625: #include yann@1625: yann@1625: @@ -28,5 +29,10 @@ yann@1625: int yann@1625: __fallocate64_l64 (int fd, int mode, __off64_t offset, __off64_t len) yann@1625: { yann@1625: +#ifdef __NR_fallocate yann@1625: return __call_fallocate (fd, mode, offset, len); yann@1625: +#else yann@1625: + __set_errno (ENOSYS); yann@1625: + return -1; yann@1625: +#endif yann@1625: }