Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/glibc/2.11: 0077_all_i386-glibc-no-fallocate.patch
Date: Tue, 10 Nov 2009 01:59:33
Message-Id: E1N7g13-0002Td-N3@stork.gentoo.org
1 vapier 09/11/10 01:59:29
2
3 Added: 0077_all_i386-glibc-no-fallocate.patch
4 Log:
5 fix build on x86 with older kernel headers missing __NR_fallocate #274269
6
7 Revision Changes Path
8 1.1 src/patchsets/glibc/2.11/0077_all_i386-glibc-no-fallocate.patch
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.11/0077_all_i386-glibc-no-fallocate.patch?rev=1.1&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.11/0077_all_i386-glibc-no-fallocate.patch?rev=1.1&content-type=text/plain
12
13 Index: 0077_all_i386-glibc-no-fallocate.patch
14 ===================================================================
15 Fix building on x86 when older linux headers lack __NR_fallocate define.
16
17 URL: http://bugs.gentoo.org/274269
18 Reported-by: Mikael Magnusson <mikachu@×××××.com>
19
20 2009-11-09 Mike Frysinger <vapier@g.o>
21
22 * sysdeps/unix/sysv/linux/i386/fallocate.c: Include errno.h.
23 (fallocate): Return ENOSYS if __NR_fallocate is not defined.
24 * sysdeps/unix/sysv/linux/i386/fallocate64.c: Likewise.
25
26 diff --git a/sysdeps/unix/sysv/linux/i386/fallocate.c b/sysdeps/unix/sysv/linux/i386/fallocate.c
27 index 7a943e4..14e7883 100644
28 --- a/sysdeps/unix/sysv/linux/i386/fallocate.c
29 +++ b/sysdeps/unix/sysv/linux/i386/fallocate.c
30 @@ -16,6 +16,7 @@
31 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
32 02111-1307 USA. */
33
34 +#include <errno.h>
35 #include <fcntl.h>
36 #include <sysdep.h>
37
38 @@ -28,5 +29,10 @@ extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len)
39 int
40 fallocate (int fd, int mode, __off_t offset, __off_t len)
41 {
42 +#ifdef __NR_fallocate
43 return __call_fallocate (fd, mode, offset, len);
44 +#else
45 + __set_errno (ENOSYS);
46 + return -1;
47 +#endif
48 }
49 diff --git a/sysdeps/unix/sysv/linux/i386/fallocate64.c b/sysdeps/unix/sysv/linux/i386/fallocate64.c
50 index 4998f5e..85f315c 100644
51 --- a/sysdeps/unix/sysv/linux/i386/fallocate64.c
52 +++ b/sysdeps/unix/sysv/linux/i386/fallocate64.c
53 @@ -16,6 +16,7 @@
54 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
55 02111-1307 USA. */
56
57 +#include <errno.h>
58 #include <fcntl.h>
59 #include <sysdep.h>
60
61 @@ -28,5 +29,10 @@ extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len)
62 int
63 fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
64 {
65 +#ifdef __NR_fallocate
66 return __call_fallocate (fd, mode, offset, len);
67 +#else
68 + __set_errno (ENOSYS);
69 + return -1;
70 +#endif
71 }