Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Feb 1999 16:35:13 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        mjacob@feral.com, wollman@khavrinen.lcs.mit.edu
Cc:        cvs-commiters@FreeBSD.ORG
Subject:   Re: sizeof (ptr) != sizeof (unsigned)
Message-ID:  <199902020535.QAA19993@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> >       bcopy(&p1->p_procsig->ps_begincopy, &p2->p_procsig->ps_begincopy,
>> >                         (unsigned)&p1->p_procsig->ps_endcopy -
>> >                         (unsigned)&p1->p_procsig->ps_begincopy);
>> 
>> > What's this for?
>> 
>> This copies just the part of the proc struct that's supposed to be
>> copied.  It would be cleaner if the operands were cast to `char *',
>> but it should work either way on any processor architecture the kernel
>
>
>Not if the cast to unsigned truncates the top 32 bits on an alpha

I initially thought that this isn't a problem.  It is a problem if the
address range crosses a 4G boundary.  I guess it still isn't a problem
even if the alpha kernel covers more than 4G virtual, since proc structs
are malloc()ed so they don't even cross a page boundary if they are no
larger than 1 page.

>prior to
>(re)promoting it to caddr_t for the call to bcopy...

No, the arg is a size_t, not a pointer.

Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902020535.QAA19993>