RTMpGetCount-posix.cpp revision c58f1213e628a545081c70e26c6b67a841cff880
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync * IPRT - RTMpGetCount, POSIX.
c58f1213e628a545081c70e26c6b67a841cff880vboxsync * Copyright (C) 2006-2010 Oracle Corporation
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * available from http://www.virtualbox.org. This file is free software;
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * you can redistribute it and/or modify it under the terms of the GNU
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * General Public License (GPL) as published by the Free Software
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * The contents of this file may alternatively be used under the terms
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * of the Common Development and Distribution License Version 1.0
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * VirtualBox OSE distribution, in which case the provisions of the
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * CDDL are applicable instead of those of the GPL.
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * You may elect to license modified versions of this file under the
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * terms and conditions of either the GPL or the CDDL or both.
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync/*******************************************************************************
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync* Header Files *
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync*******************************************************************************/
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * The sysconf way (linux and others).
5ece3177d897caf5fdc7bdaffbd95a053ba8a158vboxsync#if defined(_SC_NPROCESSORS_MAX) || defined(_SC_NPROCESSORS_CONF) || defined(_SC_NPROCESSORS_ONLN)
1b132cc0e32ad7603ae736933c6e085dd08b3a90vboxsync * The BSD 4.4 way.
5ece3177d897caf5fdc7bdaffbd95a053ba8a158vboxsync int rc = sysctl(aiMib, RT_ELEMENTS(aiMib), &cCpus, &cb, NULL, 0);