provide loff_t for splice syscall
authorRich Felker <dalias@aerifal.cx>
Fri, 7 Sep 2012 03:49:44 +0000 (23:49 -0400)
committerRich Felker <dalias@aerifal.cx>
Fri, 7 Sep 2012 03:49:44 +0000 (23:49 -0400)
so far, this is the only actual use of loff_t i've found. some
software, including glib, assumes loff_t must exist if splice exists;
this is a reasonable assumption since the official prototype for
splice uses loff_t, as it always works with 64-bit offsets regardless
of the selected libc off_t size. i'm using #define for now rather than
a typedef to make it easy to define in other headers if necessary
(like the LFS64 ugliness), but it may be necessary to add it to
alltypes.h eventually if other functions end up needing it.

include/fcntl.h

index f0e5671..87ecf59 100644 (file)
@@ -120,6 +120,7 @@ struct f_owner_ex {
 #define SPLICE_F_GIFT 8
 ssize_t vmsplice(int, const struct iovec *, size_t, unsigned);
 ssize_t splice(int, off_t *, int, off_t *, size_t, unsigned);
+#define loff_t off_t
 #endif
 
 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)