tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: setsockopt() compat issue
Bryce Simonds wrote:
> Indeed,
>
> So far as I'm aware the size of an "int" in C is dictated by either the OS
> or the compiler, not sure which. Though if I'm not mistaken the ANSI board
> caved in to pressure and made int a 32bit size in a later revision of the
> standard.
>
Not that I have read the rest of the discussion, but there is no standard
specifying the size of an int. C99 specify the least size of all integer types,
and posix has opinions about character size.
-- Ragge
> In any event, just going off of the stack trace made it appear that a 64bit
> integer was being passed in. In this case an uninitialized void pointer was
> passed in, which is NOT what is documented for setsockopt() at all, and I
> would agree that this program should break if it's doing something that
> crazy. Even if it HAD been passing in a 64 bit integer it should have set
> the initial value of it before calling setsockopt()!
>
> Bryce Simonds
>
> -----Original Message-----
> From: tech-kern-owner%NetBSD.org@localhost
> [mailto:tech-kern-owner%NetBSD.org@localhost] On
> Behalf Of Manuel Bouyer
> Sent: Friday, October 17, 2008 12:53 PM
> To: Iain Hibbert
> Cc: tech-kern%NetBSD.org@localhost
> Subject: Re: setsockopt() compat issue
>
> On Fri, Oct 17, 2008 at 06:12:04PM +0100, Iain Hibbert wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>>
>> On Fri, 17 Oct 2008, Manuel Bouyer wrote:
>>
>>> lets just hope there's no binary-only tools that would run into this :)
>>> It affects only 64bit platforms anyway ...
>> Out of interest, would this always affect 64-bit platforms? I thought
>> somehow that they used 64-bit ints in any case in which case this would
>> not bite..
>
> No, LP64 platforms have 64bits long and pointer (that's why it
> "LP") but 32bits int. There may be platforms with 64bits int, long
> and pointer (they would be called ILP64 I guess) but AFAIK none
> are supported by NetBSD.
>
Home |
Main Index |
Thread Index |
Old Index