[git commit future] splice, sync_file_range: mark them as GNU extensions

Peter S. Mazinger ps.m at gmx.net
Wed Mar 30 11:53:36 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=9820a0f50ed29c75136f5ac8a5e516071b56ac1b
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future

They can't be compiled if LFS is disabled, they are using off64_t.

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
---
 libc/sysdeps/linux/common/splice.c          |    9 +++++----
 libc/sysdeps/linux/common/sync_file_range.c |   14 +++++++-------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/libc/sysdeps/linux/common/splice.c b/libc/sysdeps/linux/common/splice.c
index 83f348a..4a32c54 100644
--- a/libc/sysdeps/linux/common/splice.c
+++ b/libc/sysdeps/linux/common/splice.c
@@ -8,9 +8,10 @@
  */
 
 #include <sys/syscall.h>
-#include <fcntl.h>
 
-#ifdef __NR_splice
-_syscall6(ssize_t, splice, int, __fdin, __off64_t *, __offin, int, __fdout,
-	__off64_t *, __offout, size_t, __len, unsigned int, __flags)
+#if defined __NR_splice && defined __UCLIBC_HAS_LFS__ && defined __USE_GNU
+# include <fcntl.h>
+
+_syscall6(ssize_t, splice, int, __fdin, off64_t *, __offin, int, __fdout,
+	  off64_t *, __offout, size_t, __len, unsigned int, __flags)
 #endif
diff --git a/libc/sysdeps/linux/common/sync_file_range.c b/libc/sysdeps/linux/common/sync_file_range.c
index d24403e..b07f8e5 100644
--- a/libc/sysdeps/linux/common/sync_file_range.c
+++ b/libc/sysdeps/linux/common/sync_file_range.c
@@ -8,14 +8,15 @@
  */
 
 #include <sys/syscall.h>
-#if defined __USE_GNU
-#include <fcntl.h>
 
-#if defined __NR_sync_file_range && defined __UCLIBC_HAS_LFS__
-#define __NR___syscall_sync_file_range __NR_sync_file_range
+#if defined __NR_sync_file_range && defined __UCLIBC_HAS_LFS__ && defined __USE_GNU
+# include <fcntl.h>
+
+# define __NR___syscall_sync_file_range __NR_sync_file_range
 static __inline__ _syscall6(int, __syscall_sync_file_range, int, fd,
-		off_t, offset_hi, off_t, offset_lo,
-		off_t, nbytes_hi, off_t, nbytes_lo, unsigned int, flags)
+			    off_t, offset_hi, off_t, offset_lo,
+			    off_t, nbytes_hi, off_t, nbytes_lo, unsigned int, flags)
+
 int sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags)
 {
 	return __syscall_sync_file_range(fd,
@@ -24,4 +25,3 @@ int sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags)
 		flags);
 }
 #endif
-#endif
-- 
1.7.3.4



More information about the uClibc-cvs mailing list