qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] linux-user/syscall.c: Let lv always match val i


From: Chen Gang
Subject: Re: [Qemu-devel] [PATCH] linux-user/syscall.c: Let lv always match val in do_getsockopt()
Date: Thu, 14 Jan 2016 17:01:35 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

On 2016年01月14日 16:15, Laurent Vivier wrote:
> Le 14/01/2016 07:24, address@hidden a écrit :
>> From: Chen Gang <address@hidden>
>>
>> After host_to_target_sock_type(), the length of val may be changed, so
>> calculate the related lv, too.
>>
>> Signed-off-by: Chen Gang <address@hidden>
>> ---
>>  linux-user/syscall.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
>> index fcdca2a..0e95f35 100644
>> --- a/linux-user/syscall.c
>> +++ b/linux-user/syscall.c
>> @@ -1841,6 +1841,7 @@ static abi_long do_getsockopt(int sockfd, int level, 
>> int optname,
>>              return ret;
>>          if (optname == SO_TYPE) {
>>              val = host_to_target_sock_type(val);
>> +            lv = (val >> 8) ? 4 : 1;
> 
> It seems the kernel always returns sizeof(int) (for all archs), what is
> the aim of reducing the size ?
> 

I am not quite sure whether kernel always returns sizeof(int) (I guess,
it should be).

For me, if you are sure, we can skip this patch.

Thanks.
-- 
Chen Gang (陈刚)

Open, share, and attitude like air, water, and life which God blessed



reply via email to

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