Bug#641868: alpha: fallocate() in libc6.1 but no declaration in fcntl.h
On 17/09/11 12:08, Jonathan Nieder wrote:
> Michael Cree wrote:
>
>> The fallocate() interface is present in libc6.1 on Alpha as is easily
>> verified by:
> [...]
>> Only the posix_fallocate() interface is declared in the headers as
>> verified by:
> [...]
>> Source package libtorrent FTBFS because of this.
>
> Yep, looks like glibc-ports's
> sysdeps/unix/sysv/linux/alpha/bits/fcntl.h did not get updated at the
> same time as cvs/glibc-2_10~159 (Declare fallocate{,64}, 2009-03-03)
> and the corresponding changes for other ports.
>
> The source is at <git://sourceware.org/git/glibc-ports.git> (and the
> analagous source from glibc proper is at
> <git://sourceware.org/git/glibc.git>). Care to suggest a patch?
Suggested patch attached. Untested at present.
Cheers
Michael.
>From e23765440e54566ed86469e1ba4899160a73cfb1 Mon Sep 17 00:00:00 2001
From: Michael Cree <mcree@orcon.net.nz>
Date: Sat, 17 Sep 2011 17:45:37 +1200
Subject: [PATCH] Alpha: add fallocate declaration to fcntl.h
---
sysdeps/unix/sysv/linux/alpha/bits/fcntl.h | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
index e5e726b..7d10249 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
@@ -252,6 +252,23 @@ extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
extern ssize_t tee (int __fdin, int __fdout, size_t __len,
unsigned int __flags);
+/* Reserve storage for the data of the file associated with FD. */
+# ifndef __USE_FILE_OFFSET64
+extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len);
+# else
+# ifdef __REDIRECT
+extern int __REDIRECT (fallocate, (int __fd, int __mode, __off64_t __offset,
+ __off64_t __len),
+ fallocate64);
+# else
+# define fallocate fallocate64
+# endif
+# endif
+# ifdef __USE_LARGEFILE64
+extern int fallocate64 (int __fd, int __mode, __off64_t __offset,
+ __off64_t __len);
+# endif
+
#endif
__END_DECLS
--
1.7.4.3
Reply to: