This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 3/4] Consolidate pread/pread64 implementations
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org, Adhemerval Zanella <adhemerval dot zanella at linaro dot com>
- Date: Mon, 4 Jan 2016 10:42:14 -0200
- Subject: Re: [PATCH 3/4] Consolidate pread/pread64 implementations
- Authentication-results: sourceware.org; auth=none
- References: <1447855356-4140-1-git-send-email-adhemerval dot zanella at linaro dot org> <1447855356-4140-4-git-send-email-adhemerval dot zanella at linaro dot org> <20151229172810 dot GO25803 at vapier dot lan>
On 29-12-2015 15:28, Mike Frysinger wrote:
> On 18 Nov 2015 12:02, Adhemerval Zanella wrote:
>> This patch consolidates all the pread/pread64 implementation for Linux
>> in only one (sysdeps/unix/sysv/linux/pread.c). It also removes the
>> syscall from the auto-generation using assembly macros.
>>
>> For pread{64} offset argument placement the new SYSCALL_LL{64} macro
>> is used. For pread ports that do not define __NR_pread will use
>> __NR_pread64 and for pread64 ports that dot define __NR_pread64 will
>> use __NR_pread for the syscall.
>
> pretty sure you just broke sh here. while it doesn't have the 64-bit
> arg alignment issue, it has a wart where it copied the kernel interface
> of one. you can see it in the files you deleted:
Indeed, my understanding is SH also requires __ASSUME_ALIGNED_REGISTER_PAIRS.
I will change it for the 1/4 patch part.
>
>> --- a/sysdeps/unix/sysv/linux/sh/pread.c
>> +++ /dev/null
>>
>> -ssize_t
>> -__libc_pread (int fd, void *buf, size_t count, off_t offset)
>> -{
>> - return SYSCALL_CANCEL (pread, fd, buf, count, 0,
>> - __LONG_LONG_PAIR (offset >> 31, offset));
>> -}
>> --- a/sysdeps/unix/sysv/linux/sh/pread64.c
>> +++ /dev/null
>>
>> -ssize_t
>> -__libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
>> -{
>> - return SYSCALL_CANCEL (pread, fd, buf, count, 0,
>> - __LONG_LONG_PAIR ((off_t) (offset >> 32),
>> - (off_t) (offset & 0xffffffff)));
>> -}
> -mike
>