Re: [RFC PATCH] sync_file_range: fix the incorrect args order

Bernhard Reutner-Fischer <[email protected]>
Newsgroups gmane.comp.lib.uclibc.general
Message-ID <[email protected]>
On October 27, 2014 8:10:46 AM GMT+01:00, Zheng Junling <[email protected]> wrote:
>Hi, Bernhard:
>
>Do you encounter this bug?

Fixed on master now.
Thanks,

>
>Or could you give me some suggestions for this problem?
>
>Thanks!
>
>Junling
>
>On 2014/10/13 16:41, Zheng Junling wrote:
>> uClibc handles the sync_file_range2 syscall as well as
>sync_file_range,
>> passes "flags" as the last argument. However, "flags" should be the
>> second argument in sync_file_range2 syscall.
>> 
>> This patch only fixes this bug in arm, not in powerpc and mips yet.
>And
>> I expect a complete patch. Thanks!
>> 
>> ----------------------------------------
>> 
>> Signed-off-by: Zheng Junling <[email protected]>
>> ---
>>  libc/sysdeps/linux/common/sync_file_range.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/libc/sysdeps/linux/common/sync_file_range.c
>b/libc/sysdeps/linux/common/sync_file_range.c
>> index 8d4ed92..db4f800 100644
>> --- a/libc/sysdeps/linux/common/sync_file_range.c
>> +++ b/libc/sysdeps/linux/common/sync_file_range.c
>> @@ -28,8 +28,13 @@ static int __NC(sync_file_range)(int fd, off64_t
>offset, off64_t nbytes, unsigne
>>  	return INLINE_SYSCALL(sync_file_range, 7, fd, 0,
>>  			OFF64_HI_LO(offset), OFF64_HI_LO(nbytes), flags);
>>  #  else
>> +#   ifdef __NR_sync_file_range2
>> +	return INLINE_SYSCALL(sync_file_range, 6, fd, flags,
>> +			OFF64_HI_LO(offset), OFF64_HI_LO(nbytes));
>> +#   else
>>  	return INLINE_SYSCALL(sync_file_range, 6, fd,
>>  			OFF64_HI_LO(offset), OFF64_HI_LO(nbytes), flags);
>> +#   endif
>>  #  endif
>>  }
>>  CANCELLABLE_SYSCALL(int, sync_file_range, (int fd, off64_t offset,
>off64_t nbytes, unsigned int flags), (fd, offset, nbytes, flags))
>>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.