Re: dhcpcd-7.0.0 on 32-bit system
Neal P. Murphy
Fri Jan 19 17:16:03 2018
On Fri, 19 Jan 2018 09:30:25 +0000
Roy Marples <roy@xxxxxxxxxxxx> wrote:
> Hi
>
> On 18/01/2018 23:48, jobhunts02@xxxxxxx wrote:
> > I see that dhcpcd-7.0.0 uses ULL’s. Can it be configured to run on a 32-bit system? If so, how? If not, what version of dhcpcd would I need to use? I want support for IPv6.
>
> dhcpcd works fine on 32-bits.
> In fact my current main dev platform is NetBSD/i386 thanks to my 2yold
> ripping the keys out of my x86_64 laptop.
>
> How does this work? Well, modern C (as of C99 I think) says that the
> dialect must support unsigned long long and how this works on the
> hardware is up to the compiler. As you can't put a 64-bit number into a
> 32-bit one, you need to use 2x 32-bit numbers. This isn't optimal in
> terms of speed and size - ideally we keep things at or below 32-bits on
> on a 32-bit platform, but frankly it's very convenient and an easier
> code path to use 64-bits as they are available.
IIRC, the 32-bit Linux kernel has used 64-bit ints for a long time now in a lot of places. One such use is in filesystems in order to 'break' the 2GiB or 4GiB limits on file sizes.
Archive administrator: postmaster@marples.name