[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: First tests with qemu-m68k and sbuild




Le 23/11/2015 15:23, John Paul Adrian Glaubitz a écrit :
> On 11/19/2015 01:52 PM, Laurent Vivier wrote:
>> I didn't really search the reason of that before, but:
>>
>> Socketcall 20 seems to be sendmmsg() (and 19 is recvmmsg()).
>>
>> I think it should be easy to add as the do_sendmmsg() and do_recvmmsg()
>> already exist in linux-user/syscall.c
>
> I'm not sure actually why it's called "Socketcall". Is that an
> offset in the syscall numbering?
>

yes, see linux-user/syscall.c: do_socketcall() and TARGET_NR_socketcall.

man socketcall: socketcall()  is  a  common  kernel  entry  point for
the socket system calls.

in linux-user/syscall_defs.h, you can add SOCKOP_sendmmsg and
SOCKOP_recvmmsg (as are defined SYS_RECVMMSG and SYS_SENDMMSG) and the
according call to do_sendrecvmmsg() in do_socketcall().

> In any case, TARGET_NR_sendmmsg and TARGET_NR_recvmmsg are not
> defined here:
>
>>
>
https://github.com/vivier/qemu-m68k/blob/680x0-v2.3.0/linux-user/m68k/syscall_nr.h
>
> According to the kernel sources, recvmmsg is defined as 371 and sendmmsg
> as 372:
>
>>
>
https://github.com/torvalds/linux/blob/master/arch/m68k/kernel/syscalltable.S#L394
>
> And hence once should add:
>
> #define TARGET_NR_recvmmsg 371
> #define TARGET_NR_sendmmsg 372
>
> The implementation can be found here:
>
>>
>
https://github.com/vivier/qemu-m68k/blob/680x0-v2.3.0/linux-user/syscall.c#L7848
>
> What about the other syscalls 349 through 374, btw?

All these syscalls appear with 4.3, so they are not so old, and will not
be used in the libc on m68k before a while:

https://github.com/torvalds/linux/commit/5b3f33eb408ad06acf59b09fe0550bf3756e320a

So for the moment, we should implement the socketcall values, but you
can also update the syscall_nr.h with the new syscall values from the
kernel.

Laurent


Reply to: