From e21479da34bbe39fb9d99e2f6e323fd1a942d9cb Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 16 Apr 2011 01:07:23 +0200 Subject: *64.[cS]: use _lfs_64.h instead of features.h and remove LFS guard _lfs_64.h makes the compile fail, if LFS is not enabled, no need for the guard. Reorganize to include only the minimal necessary headers. Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/ftruncate64.c | 43 ++++++++++++++------------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'libc/sysdeps/linux/common/ftruncate64.c') diff --git a/libc/sysdeps/linux/common/ftruncate64.c b/libc/sysdeps/linux/common/ftruncate64.c index c5a616007..012a1f4ed 100644 --- a/libc/sysdeps/linux/common/ftruncate64.c +++ b/libc/sysdeps/linux/common/ftruncate64.c @@ -10,47 +10,42 @@ * just the macro we need to order things, __LONG_LONG_PAIR. */ -#include +#include <_lfs_64.h> +#include +#include -#ifdef __UCLIBC_HAS_LFS__ +#ifdef __NR_ftruncate64 +# include -# include -# include -# include -# include -# include -# include - - -# ifdef __NR_ftruncate64 - -# if __WORDSIZE == 64 +# if __WORDSIZE == 64 /* For a 64 bit machine, life is simple... */ _syscall2(int, ftruncate64, int, fd, __off64_t, length) -# elif __WORDSIZE == 32 +# elif __WORDSIZE == 32 +# include +# include /* The exported ftruncate64 function. */ int ftruncate64 (int fd, __off64_t length) { uint32_t low = length & 0xffffffff; uint32_t high = length >> 32; -# if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__) +# if defined(__UCLIBC_TRUNCATE64_HAS_4_ARGS__) return INLINE_SYSCALL(ftruncate64, 4, fd, 0, __LONG_LONG_PAIR (high, low)); -# else +# else return INLINE_SYSCALL(ftruncate64, 3, fd, __LONG_LONG_PAIR (high, low)); -# endif +# endif } -# else /* __WORDSIZE */ -# error Your machine is not 64 bit or 32 bit, I am dazed and confused. -# endif /* __WORDSIZE */ - -# else /* __NR_ftruncate64 */ +# else /* __WORDSIZE */ +# error Your machine is not 64 bit or 32 bit, I am dazed and confused. +# endif /* __WORDSIZE */ +#else /* __NR_ftruncate64 */ +# include int ftruncate64 (int fd, __off64_t length) { @@ -65,7 +60,5 @@ int ftruncate64 (int fd, __off64_t length) return -1; } -# endif /* __NR_ftruncate64 */ +#endif /* __NR_ftruncate64 */ libc_hidden_def(ftruncate64) - -#endif /* __UCLIBC_HAS_LFS__ */ -- cgit v1.2.3