I
Iñaki Baz Castillo
El Viernes, 15 de Enero de 2010, Walton Hoops escribi=C3=B3:
No, I've tested it in a 64 bits server running Linux 32 bits:
RbConfig::CONFIG['host_os'] =3D> "linux-gnu"
RbConfig::CONFIG['host_cpu'] =3D> "i486"
1.size =3D> 4
=20
=2D-=20
I=C3=B1aki Baz Castillo <[email protected]>
=20El Viernes, 15 de Enero de 2010, I=C3=B1aki Baz Castillo escribi=C3=B3:Note that to know the bits it uses "rbconfig" gem, and them:
Well, "rbconfig" is not a gem but a Ruby built in library.
In my server RbConfig::CONFIG['host_os'] =3D "linux-gnu" so finally it
ends doing:
if (1<<32).class =3D=3D Fixnum
64
else
32
end
Which is basically the same as doing
if 1.size =3D=3D 8
64
else
32
end
Definitively I don't like "os" gem at all. It could use
RbConfig::CONFIG['host_cpu'] rather than the not reliable
RbConfig::CONFIG['host_os']:
a) 32 bits host:
RbConfig::CONFIG['host_os'] =3D> "linux-gnu"
RbConfig::CONFIG['host_cpu'] =3D> "i486"
b) 64 bits host:
RbConfig::CONFIG['host_os'] =3D> "linux-gnu"
RbConfig::CONFIG['host_cpu'] =3D> "x86_64"
submit a bug! http://github.com/rdp/os
=20
My main concern with that though:
Would RbConfig::CONFIG['host_cpu'] return "x86_64" if I'm running 32-bit
Linux on a 64-bit CPU?
No, I've tested it in a 64 bits server running Linux 32 bits:
RbConfig::CONFIG['host_os'] =3D> "linux-gnu"
RbConfig::CONFIG['host_cpu'] =3D> "i486"
1.size =3D> 4
=20
=2D-=20
I=C3=B1aki Baz Castillo <[email protected]>