qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4] linux-user: fix to handle variably sized SIO


From: Laurent Vivier
Subject: Re: [Qemu-devel] [PATCH v4] linux-user: fix to handle variably sized SIOCGSTAMP with new kernels
Date: Sun, 14 Jul 2019 15:31:05 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2

Le 14/07/2019 à 13:33, Arnd Bergmann a écrit :
> On Sun, Jul 14, 2019 at 12:41 PM Richard Henderson
> <address@hidden> wrote:
>>
>> On 7/12/19 3:55 PM, Arnd Bergmann wrote:
>>> glibc will have to create a definition that matches the kernel, which uses
>>>
>>> struct __kernel_timespec {
>>>     __s64 tv_sec;
>>>     __s64 tv_nsec;
>>> };
>>>
>>> As posix requires tv_nsec to be 'long', you need padding between
>>> tv_sec and tv_nsec to have a libc definition matching the kernel's
>>> binary layout.
>>
>> Yes, but that's glibc's lookout.  All qemu cares about emulating is the 
>> kernel
>> interface.  So I think Laurent is right here, in that two reads handle the
>> above structure just fine.
> 
> But that only works if the structure defined by qemu matches the kernel's.
> 
> The structure that Laurent proposed
> 
> struct target_timeval64 {
>     abi_llong tv_sec;
>     abi_long tv_usec;
> };
> 
> is not compatible with the kernel or the glibc structure.

Yes, you're right. The next patch revision will change this to the
kernel structure one.

Thanks,
Laurent



reply via email to

[Prev in Thread] Current Thread [Next in Thread]