From 8e2424ffece289ff88870141674c9fc58b43f763 Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Wed, 28 May 2008 11:40:29 +0000 Subject: avr32: splice(), vmsplice() and tee() support Add the necessary prototypes and definitions for splice(), vmsplice() and tee() to work. Without this, they won't even compile. --- libc/sysdeps/linux/avr32/bits/fcntl.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'libc/sysdeps/linux/avr32') diff --git a/libc/sysdeps/linux/avr32/bits/fcntl.h b/libc/sysdeps/linux/avr32/bits/fcntl.h index 1abff17ef..3bf4e1ac8 100644 --- a/libc/sysdeps/linux/avr32/bits/fcntl.h +++ b/libc/sysdeps/linux/avr32/bits/fcntl.h @@ -3,6 +3,9 @@ #endif #include +#ifdef __USE_GNU +# include +#endif /* * open/fcntl - O_SYNC is only implemented on blocks devices and on files @@ -163,3 +166,31 @@ struct flock64 { # define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ #endif + +#ifdef __USE_GNU + +/* Flags for splice() and vmsplice() */ +# define SPLICE_F_MOVE 1 /* Move pages instead of copying */ +# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing + (but we may still block on the fd + we splice from/to) */ +# define SPLICE_F_MORE 4 /* Expect more data */ +# define SPLICE_F_GIFT 8 /* Pages passed in are a gift */ + +__BEGIN_DECLS + +/* Splice address range into a pipe */ +extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, + size_t __count, unsigned int __flags); + +/* Splice two files together */ +extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, + __off64_t *__offout, size_t __len, + unsigned int __flags); + +/* In-kernel implementation of tee for pipe buffers */ +extern ssize_t tee (int __fdin, int __fdout, size_t __len, + unsigned int __flags); + +__END_DECLS +#endif -- cgit v1.2.3