lkml.org 
[lkml]   [2013]   [Dec]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] Use __kernel_long_t in struct mq_attr
From
On Thu, Dec 26, 2013 at 9:53 AM, H. Peter Anvin <hpa@zytor.com> wrote:
> On 12/26/2013 07:54 AM, H.J. Lu wrote:
>> On Wed, Dec 25, 2013 at 08:58:34AM -0800, H.J. Lu wrote:
>>> Both x32 and x86-64 use the same struct mq_attr for system calls. But
>>> x32 long is 32-bit. This patch replaces long with __kernel_long_t in
>>> struct mq_attr.
>>>
>>
>> Here is the updated patch which uses __kernel_long_t only if
>> __BITS_PER_LONG == 64.
>>
>
> That seems wrong in multiple ways... not only does it add more clutter,

It is true for more clutter.

> but it would seem to give the wrong types when __BITS_PER_LONG in
> userspace is 32.
>

For x32, __BITS_PER_LONG is 64, not 32. If __BITS_PER_LONG
is 32, my patch doesn't change anything. If it works before,
it still works. If it is broken before, it remains broken.

I prefer my first patch, which is less clutter. But I can't guarantee
it is correct for all x3-like ABIs. My second patch has more
clutter, but it has no impact on other ABIs.

--
H.J.


\
 
 \ /
  Last update: 2013-12-26 19:21    [W:0.037 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site