issue with devstat_buildmatch(3) and certain strings

Sergey Kandaurov pluknet at freebsd.org
Fri Apr 1 16:13:28 UTC 2011


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


More information about the freebsd-current mailing list