On Fri, Mar 09, 2007 at 03:22:08PM +0000, Richard W.M. Jones wrote:
This patch:
* Adds virConnectGetCapabilities which returns an XML description of the
capabilities of the driver or hypervisor under this connection (see
below for more about the XML format).
+ /* 32 or 64 bit host? */
+ const char *bits = strstr (utsname.machine, "64") != NULL ? "64"
: "32";
Will this work safely on all OS / arches ? I guess ia64, x86_64, sparc64
and ppc64 all give the right results.
One alternative would be using 'sizeof(void*) * 8', although if someone used
a 32-bit set of libs on a 64-bit machine this would give wrong answer.
Regards,
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules:
http://search.cpan.org/~danberr/ -=|
|=- Projects:
http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|