system.h revision 4a5d1cb72abd351221a0d5bdce3a01b071f697a9
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/** @file
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * IPRT - System Information.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * available from http://www.virtualbox.org. This file is free software;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * you can redistribute it and/or modify it under the terms of the GNU
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * General Public License (GPL) as published by the Free Software
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * The contents of this file may alternatively be used under the terms
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * of the Common Development and Distribution License Version 1.0
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * VirtualBox OSE distribution, in which case the provisions of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * CDDL are applicable instead of those of the GPL.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * You may elect to license modified versions of this file under the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * terms and conditions of either the GPL or the CDDL or both.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * additional information or have any questions.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#ifndef ___iprt_system_h
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#define ___iprt_system_h
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#include <iprt/cdefs.h>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#include <iprt/types.h>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync__BEGIN_DECLS
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/** @defgroup grp_rt_system RTSystem - System Information
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * @ingroup grp_rt
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * @{
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/**
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Info level for RTSystemGetOSInfo().
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
typedef enum RTSYSOSINFO
{
RTSYSOSINFO_INVALID = 0, /**< The usual invalid entry. */
RTSYSOSINFO_PRODUCT, /**< OS product name. (uname -o) */
RTSYSOSINFO_RELEASE, /**< OS release. (uname -r) */
RTSYSOSINFO_VERSION, /**< OS version, optional. (uname -v) */
RTSYSOSINFO_SERVICEPACK, /**< Service/fix pack level, optional. */
RTSYSOSINFO_END /**< End of the valid info levels. */
} RTSYSOSINFO;
/**
* Queries information about the OS.
*
* @returns IPRT status code.
* @retval VINF_SUCCESS on success.
* @retval VERR_INVALID_PARAMETER if enmInfo is invalid.
* @retval VERR_INVALID_POINTER if pszInfoStr is invalid.
* @retval VERR_BUFFER_OVERFLOW if the buffer is too small. The buffer will
* contain the chopped off result in this case, provided cchInfo isn't 0.
* @retval VERR_NOT_SUPPORTED if the info level isn't implemented. The buffer will
* contain an empty string.
*
* @param enmInfo The OS info level.
* @param pszInfo Where to store the result.
* @param cchInfo The size of the output buffer.
*/
RTDECL(int) RTSystemQueryOSInfo(RTSYSOSINFO enmInfo, char *pszInfo, size_t cchInfo);
/** @} */
__END_DECLS
#endif