[PATCH] Fix build with newer glibc/kernel-headers
authorJens Axboe <jens.axboe@oracle.com>
Mon, 5 Feb 2007 14:24:07 +0000 (15:24 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 5 Feb 2007 14:24:07 +0000 (15:24 +0100)
On newer systems (SUSE 10.2 for one), the build fails because
the splice functions and flags are available in the normal
headers.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
splice.h

index eb0654cc4ab1958ffdf99baefac7a9ff741c2681..fdcd915647df660b82eaccb7f83f44a4a706eb20 100644 (file)
--- a/splice.h
+++ b/splice.h
@@ -26,6 +26,8 @@
 #error unsupported arch
 #endif
 
+#ifndef SPLICE_F_MOVE
+
 #define SPLICE_F_MOVE  (0x01)  /* move pages instead of copying */
 #define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */
                                 /* we may still block on the fd we splice */
@@ -51,6 +53,8 @@ static inline int vmsplice(int fd, const struct iovec *iov,
        return syscall(__NR_sys_vmsplice, fd, iov, nr_segs, flags);
 }
 
+#endif /* SPLICE_F_MOVE defined */
+
 #define SPLICE_SIZE    (64*1024)
 
 #define BUG_ON(c) assert(!(c))