[PATCH] LoongArch: Add syscall.c for getting correct return value

XingLi lixing@loongson.cn
Fri Nov 25 02:37:22 GMT 2022



在 2022/11/23 下午9:36, Adhemerval Zanella Netto 写道:
> 
> 
> On 23/11/22 00:40, Xi Ruoyao wrote:
>> On Wed, 2022-11-23 at 09:57 +0800, Xing Li wrote:
>>> The __SYS_mmap syscall should return 47bits value. If we use
>>> the common syscall interface which defined in
>>> sysdeps/unix/sysv/linux/syscall.c, the syscall return value
>>> is 32bits with sign extend, which lead to mmap failure.
>>
>> Could we just change
>>
>> int r = INTERNAL_SYSCALL_NCS_CALL (number, a0, a1, a2, a3, a4, a5);
>>
>> in sysdeps/unix/sysv/linux/syscall.c to "long r = ..." instead?
>>
> 
> Yes, afaik INTERNAL_SYSCALL_NCS on all architecture returns long int.
> 
Yes, the __SYSCALL_DEFINEx all returns long in linux kernel.



More information about the Libc-alpha mailing list