[PATCH-0.9.33] common/pread_write.c: unbreak on archs without __NR_pread64

Peter Korsgaard peter at korsgaard.com
Tue Oct 15 09:52:46 UTC 2013


>>>>> "Peter" == Peter Korsgaard <peter at korsgaard.com> writes:

 Peter> Some archs (avr32 in particular) still doesn't define __NR_pread64, so
 Peter> we should fall back to __NR_pread if it isn't available.

 Peter> The code nicely checks for it, but then ends up hard coding the syscall
 Peter> to use __NR_pread64 afterwards, rendering the check useless. Fix it by
 Peter> using the result of the test instead.

 Peter> Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
 Peter> ---
 Peter> Noticed when adding the pending patches for 0.9.33.3 to Buildroot:
 Peter> http://jenkins.free-electrons.com/job/buildroot/config=atstk100x_defconfig/116/console

Ping?

 Peter>  libc/sysdeps/linux/common/pread_write.c |    2 +-
 Peter>  1 file changed, 1 insertion(+), 1 deletion(-)

 Peter> diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
 Peter> index b13de66..8562ab4 100644
 Peter> --- a/libc/sysdeps/linux/common/pread_write.c
 Peter> +++ b/libc/sysdeps/linux/common/pread_write.c
 Peter> @@ -42,7 +42,7 @@ extern __typeof(pwrite64) __libc_pwrite64;
 
 Peter>  #include <bits/kernel_types.h>
 
 Peter> -# define __NR___syscall_pread __NR_pread64
 Peter> +# define __NR___syscall_pread __NR_pread
 Peter>  static __inline__ _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
 Peter>  		size_t, count, off_t, offset_hi, off_t, offset_lo)
 
 Peter> -- 
 Peter> 1.7.10.4



-- 
Bye, Peter Korsgaard


More information about the uClibc mailing list