Re: issue with devstat_buildmatch(3) and certain strings

From: Sergey Kandaurov <pluknet_at_freebsd.org>
Date: Fri, 1 Apr 2011 20:13:26 +0400
On 1 April 2011 18:50, Warner Losh <imp_at_bsdimp.com> wrote:
> On Apr 1, 2011, at 5:40 AM, Sergey Kandaurov wrote:
>>
>>                        if (++tempstr >= &tstr[5])
>>
>>                               ^^^^
>> BTW,
>> this game with pointers might prevent devstat(3) from work on big-endian.
>
> I'm very curious about your reasoning here.
> Warner

I meant the above comparison of pointers might not work
(I'm not sure, as I have no big-endian to test). Look:

# iostat -t da,scsi,pass
tempstr=0x7fffffffcfa0, &tstr[5]=0x7fffffffcfc8
tempstr=0x7fffffffcfa8, &tstr[5]=0x7fffffffcfc8
tempstr=0x7fffffffcfb0, &tstr[5]=0x7fffffffcfc8


D'oh.. endianness doesn't matter with arrays *blush
(Unless that's some system with decreasing memory
addressing. Ok, nevermind.)

-- 
wbr,
pluknet
Received on Fri Apr 01 2011 - 14:13:28 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:13 UTC